[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Sc-devel] SCScrollView relativity



hi jan !

w = SCWindow.new;


c = SCCompositeView(w,Rect(30,30,300,300));

c.relativeOrigin = true;

c.background = "" style="color: #0000bf">Color.blue;



// although its parent is relativeOrigin, the scroll view does not position itself

s = SCScrollView(c,Rect(0,0,40,40));

s.background = "" style="color: #0000bf">Color.yellow;



// where it should be

d = SCStaticText(c,Rect(0,0,40,40));

d.background = "" style="color: #0000bf">Color.red;


w.front;


// bounds says (0,0,40,40) which is correct (relatively specified)

s.bounds;


// says (30,30,40,40) which would be correct, but that's not where its drawing

s.absoluteBounds




(

w = SCWindow.new;


c = SCCompositeView(w,Rect(30,30,300,300));

c.relativeOrigin = true;

c.background = "" style="color: #0000bf">Color.blue;



// giving it absolute bounds doesn't fix it

// its a small square, origin in the right place

s = SCScrollView(c,Rect(30,30,40,40));

s.background = "" style="color: #0000bf">Color.yellow;



// where it should be

d = SCStaticText(c,Rect(0,0,40,40));

d.background = "" style="color: #0000bf">Color.red;


// and note that the static text should be drawn on top of the scroll view

w.front;


// bounds says (30,30,40,40)  origin is correct, size would be correct but we aren't seeing that

s.bounds;


// says (60,60,40,40) origin is correct, size would be correct but we aren't seeing that

s.absoluteBounds


)


Also: when you scroll down below a certain point, one scroll wheel further and the drawing suddenly disappears (its considered off screen, does not draw).

Some buttons within the scroll view are sometimes not drawing, though they are active.  I'm not totally sure if its the scroll view's issue yet.


but its very nice to have scrolling now and with my mouse wheel too !


I added some unit tests (I'll post separately ).

but for this issue the bounds and absoluteBounds are reporting correctly but the visual is not correct.


-cx