[haiku-appserver] Re: partly paiting

  • From: Adi Oanca <adioanca@xxxxxxxxx>
  • To: haiku-appserver@xxxxxxxxxxxxx
  • Date: Thu, 27 Oct 2005 22:49:08 +0300

Hi,

Axel Dörfler wrote:
Not really. Do you just mean that:

view->Bounds().PrintToStream();
view->ScrollTo(-5, -5);
view->Bounds().PrintToStream();

will dump two different bounds?

Yes.

(the second is shifted, as is the origin of the local coordinate system)

I'm afraid I don't understand this affirmation...

These are 2 tests I made under R5:

$ ./BeApp2
bla Mouse Down: 31.000000, 30.000000
Have this BPoint: (100,100) - local coords
ConvertToParent:--> 245.000000 105.000000. Origin: 0.000000 0.000000.
Bounds():BRect(l:0.0, t:0.0, r:63.0, b:70.0)
ScrollTo(-5,-5)
ConvertToParent:--> 245.000000 105.000000. Origin: 0.000000 0.000000.
Bounds():BRect(l:-5.0, t:-5.0, r:58.0, b:65.0)
Adi: MyView::Draw() - BRect(l:-5.0, t:-5.0, r:58.0, b:65.0)
bla Mouse UP: 26.000000, 25.000000

bla Mouse Down: 26.000000, 24.000000
Have this BPoint: (100,100) - local coords
ConvertToParent:--> 250.000000 110.000000. Origin: 0.000000 0.000000.
Bounds():BRect(l:-5.0, t:-5.0, r:58.0, b:65.0)
ScrollTo(-5,-5)
ConvertToParent:--> 250.000000 110.000000. Origin: 0.000000 0.000000.
Bounds():BRect(l:-5.0, t:-5.0, r:58.0, b:65.0)
bla Mouse UP: 26.000000, 24.000000


$ ./BeApp2 bla Mouse Down: 18.000000, 31.000000 Have this BPoint: (100,100) - local coords ConvertToParent:--> 245.000000 105.000000. Origin: 0.0000 0.0000. Bounds():BRect(l:0.0, t:0.0, r:63.0, b:70.0) SetOrigin(-20,-20) ConvertToParent:--> 245.000000 105.000000. Origin: -20.0000 -20.0000. Bounds():BRect(l:0.0, t:0.0, r:63.0, b:70.0) bla Mouse UP: 18.000000, 31.000000

bla Mouse Down: 29.000000, 37.000000
Have this BPoint: (100,100) - local coords
ConvertToParent:--> 245.000000 105.000000. Origin: -20.0000 -20.0000.
Bounds():BRect(l:0.0, t:0.0, r:63.0, b:70.0)
SetOrigin(-20,-20)
ConvertToParent:--> 245.000000 105.000000. Origin: -20.0000 -20.0000.
Bounds():BRect(l:0.0, t:0.0, r:63.0, b:70.0)
bla Mouse UP: 29.000000, 37.000000



        The bounds rectangle is modified on Scroll, local origin remains 
unchanged.

The above tests show a problem. I think it's a bug.
As you see, I have BPoint pt1(100,100) and pt2(100,100) which I'm converting to parent coordinates before and after scrolling/setting_origin.
In the first case, I don't expect the results to be different after scrolling, BUT I do expect that to happen after changing local origin (offseted by (-20,-20) -> (225,85))! Unfortunately, it doesn't. Think this is a bug, do you?


While testing the scrolling thing, I discovered another 2 things:
1) before attaching a view ScrollBy/To() has no effect, and I don't understand why not? There are members into which to retain this information!
2) while in BView::Draw() {
...
Bounds().PrintToStream();
ScrollTo(-5,-5);
Bounds().PrintToStream();
...
}
Bounds() returns the same coordinates! This is wrong! It appears R5 postpones AS_SCROLL message until the update is over? There was not enough time to update the bounds rectangle in the server? Caching bounds rectangle works bad? I don't know. What it matter is that this works just fine in our app_server - Bounds() will return different rectangles.




night-night,
Adi.

Other related posts: