Canvas total width (visible width + hidden scrollable part)

≯℡__Kan透↙ 提交于 2020-01-02 20:25:29

问题


It's probably a no brainer, but I've spent the last 40 minutes or so looking for it to no avial.

I have a Canvas control with a fixed width and a horizontal scrollbar. I'm trying to find the actual width of the control. The .width (fixed width) + the part being revealed by the scrollbar. I tried explicitWidth, width + maxHorizontalScrollPosition, and some other combos but non of them hit the spot.


回答1:


Well as it seem width + maxHorizontalScrollPosition is indeed enough. The problem was with the order of events in my application (the scrollbar didn't have enough time to update it's display). I ended up adding a custom event to the class representing the content of the Canvas.



来源:https://stackoverflow.com/questions/2670280/canvas-total-width-visible-width-hidden-scrollable-part

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!