diff --git a/src/kits/interface/Bitmap.cpp b/src/kits/interface/Bitmap.cpp index 0c4098c75d..d2082105de 100644 --- a/src/kits/interface/Bitmap.cpp +++ b/src/kits/interface/Bitmap.cpp @@ -828,6 +828,8 @@ BBitmap::InitObject(BRect bounds, color_space colorSpace, uint32 flags, CleanUp(); + bounds.OffsetTo(B_ORIGIN); + // check params if (!bounds.IsValid() || !bitmaps_support_space(colorSpace, NULL)) { error = B_BAD_VALUE; diff --git a/src/kits/interface/ChannelSlider.cpp b/src/kits/interface/ChannelSlider.cpp index bb0327c755..ee6322954d 100644 --- a/src/kits/interface/ChannelSlider.cpp +++ b/src/kits/interface/ChannelSlider.cpp @@ -11,7 +11,6 @@ #include #include -#define max(a,b) ((a)>(b)?(a):(b)) const static unsigned char kVerticalKnobData[] = { @@ -406,9 +405,9 @@ BChannelSlider::GetPreferredSize(float *width, float *height) if (width) { float _width = (float)ceil(StringWidth(Label())); if (Vertical()) { - *width = max(_width, 2 + 12 * CountChannels()); + *width = max_c(_width, 2 + 12 * CountChannels()); } else { - *width = max(_width, 64); + *width = max_c(_width, 64); } } if (height) { @@ -667,7 +666,7 @@ BChannelSlider::DrawThumbs() else bitmapFrame.right += ThumbRangeFor(0); - fBacking = new BBitmap(bitmapFrame, + fBacking = new BBitmap(bitmapFrame.OffsetToCopy(B_ORIGIN), #ifdef __HAIKU__ BScreen(Window()).ColorSpace(), #else