Opened 13 years ago

Closed 13 years ago

#7817 closed bug (fixed)

BSlider with custom thumb has drawing bugs

Reported by: pulkomandy Owned by: axeld
Priority: normal Milestone: R1
Component: Kits/Interface Kit Version: R1/Development
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

Take a look at the example slider with custom thumb in the Be Book : http://www.haiku-os.org/legacy-docs/bebook/BSlider_Overview.html

The example overrides DrawThumb with something drawing an ellipse. On BeOS, this worked fine as the example shows. On Haiku, however, there is no background under the thumb, so drawing anything non-square will do weird things.

The problem is in BSlider itself, with the following piece of code :

	// ToDo: the triangle thumb doesn't delete its background, so we still have
	// to do it Note, this also creates a different behaviour for subclasses,
	// depending on the thumb style - if possible this should be avoided.
	if (Style() == B_BLOCK_THUMB) {
		BRect thumbFrame = ThumbFrame();
		if (be_control_look != NULL) {
			// fill background where shadow will be...
			// TODO: Such drawint dependent behavior should be moved into
			// BControlLook of course.
			thumbFrame.right--;
			thumbFrame.bottom--;
		}
		background.Exclude(thumbFrame);
	}

I'm not sure what this is meant to do, but it make the custom thumb look corrupted. An example of such a custom thumb in a running app is APlayer (which you can download at www.polycode.dk ).

I don't understand why is there a background.Exclude there ? Should it be removed ?

Change History (2)

comment:1 by pulkomandy, 13 years ago

Removed this code in hrev42425. Doesn't seem to have any side effects on sliders.

comment:2 by pulkomandy, 13 years ago

Resolution: fixed
Status: newclosed

For the record, the aforementioned code was to avoid flickering. It doesn't have too bad consequences with our double buffered drawing. If it proves to be a problem, we can enable the offscreen drawing mode for BSlider as explained in the Be Book.

Note: See TracTickets for help on using tickets.