[haiku-development] Re: RoundRect ButtonFrame

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Sat, 24 Mar 2012 06:39:17 -0400

On Sat, Mar 24, 2012 at 6:01 AM, Stephan Aßmus <superstippi@xxxxxx> wrote:
> Am 24.03.2012 10:21, schrieb John Scipione:
> I don't know what you mean. StrokeRect() always touches the corner pixels,
> while StrokeRoundRect() most likely doesn't if the radius is large enough.

Yes that is the problem. When StrokeRect() was called it filed the
entire outside of the frame from edge to edge. But StrokeRoundRect
doesn't draw in the corners where I was seeing glitches. The fix was
simple, just draw the whole rectangle the background color first if it
is a default button.

>> The scrollbar in this image (before my changes but fairly recent)
>> doesn't seem to have a bevel to me.
>
> I am clearly seeing the bevels on the arrow buttons and the thumb. Just make
> a screen shot before and after your changes and toggle between them. It
> should become obvious then.

Okay, now I see them. The reason that they are showing up is because
the rounded corner functions are drawing the bevel and background for
active tabs. I am reusing these functions to draw the button frames.
The solution is simple, just  pass in a flag telling the function
whether it should draw the bevel and background or not, default to
false, and pass true in from ActiveTab.

John Scipione

Other related posts: