BBitmap's constructor offsets the passed BRect to B_ORIGIN in case it isn't already. This fixes bug 301. Offset the rect in ChannelSlider too just in case.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16774 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2006-03-13 20:37:27 +00:00
parent deab92e7ed
commit 23467f07d9
2 changed files with 5 additions and 4 deletions

View File

@ -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;

View File

@ -11,7 +11,6 @@
#include <Screen.h>
#include <Window.h>
#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