[haiku-development] Re: Disable BView antialiasing

  • From: Matt <laceysnr@xxxxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 23 Sep 2009 10:46:51 +1000

>
>> There was a bug floating around on Trac that I took a look at a while
>> back to do with the red circle with a line through it on the screen
>> saver prefs (for when no active corner was selected iirc). I don't
>> know if it's still open (probably) but it was basically that the line
>> through the circle wasn't positioned nicely.
>>
>> I double checked the maths involved and it the coordinates used were
>> fine, the problem came from the sub-pixel AA :(
>>
>>
>
> I never noticed that, but it still isn't, actually, and also now that
> you mention it the line is backwards! That is, it's a forward slash,
> like "/", whereas the international No symbol is usually a backwards
> slash. I looked at the code and sure enough they are using StrokeEllipse
> and StrokeLine--I'm surprised, I assumed it was just a bitmap.
>
> If you change the code from:
>
>    size -= ceilf(sin(M_PI / 4) * size + 2);
>    rect.InsetBy(size, size);
>    StrokeLine(rect.RightTop(), rect.LeftBottom());
>
> to:
>
>    rect.left += 3;
>    rect.top += 2;
>    rect.right -= (size / 8);
>    rect.bottom -= (size / 8);
>    StrokeLine(rect.LeftTop(), rect.RightBottom());
>
> It comes out looking pretty much correct. There's no particular fancy
> formula to those numbers, they're just a fudge factor. I looked at in
> Magnifier until it looked centered and the line went all the way across.
> But it works at the current value of kStopSize, and looks ok over a
> certain range of alterations to that constant as well. From playing with
> the old code, it seems like it was somewhat of a fudge factor also; I
> mean what is the "+2"?

It's been a long time (maybe even over a year) since I looked at it -
I seem to remember coming to the conclusion that the +2 was to account
for the stroke thickness or something? I remember it making sense at
the time. Like I said, the code's not mine, I just checked the maths
and realised it was the drawing routines that were throwing it all out
of sorts.

Maybe if the devs don't mind the fudging your change can be submitted
as a patch. I've got to confess I'd not even noticed the line was the
wrong way around :) Thought something looked odd but couldn't put my
finger on it!

Other related posts: