You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ScrollView has an internal Flickable, with interactive: false. This interactive could be exposed via a public property on the ScrollView (could be called e.g. draggable or pannable), so that the ScrollView can also be panned by dragging the contents if desired. Use case: image viewer that can be panned both with the mouse and with the scroll bars.
A workaround is
scroll :=ScrollView{HorizontalLayout{Rectangle{// this would be the image or whatever you want to panTouchArea{moved=>{scroll.viewport-x+=self.mouse-x-self.pressed-x;scroll.viewport-y+=self.mouse-y-self.pressed-y;}}}}}
This looks a bit confusing (at least to me), but it works because moving the viewport also moves the TouchArea, until mouse-x - pressed-x becomes zero. (This simple version doesn't respect the boundaries of the ScrollView, it's possible to pan the inner Rectangle too far.)
The text was updated successfully, but these errors were encountered:
Ref #2235
ScrollView has an internal Flickable, with
interactive: false
. Thisinteractive
could be exposed via a public property on the ScrollView (could be called e.g.draggable
orpannable
), so that the ScrollView can also be panned by dragging the contents if desired. Use case: image viewer that can be panned both with the mouse and with the scroll bars.A workaround is
This looks a bit confusing (at least to me), but it works because moving the viewport also moves the TouchArea, until
mouse-x - pressed-x
becomes zero. (This simple version doesn't respect the boundaries of the ScrollView, it's possible to pan the inner Rectangle too far.)The text was updated successfully, but these errors were encountered: