[
https://issues.apache.org/jira/browse/PIVOT-980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15105703#comment-15105703
]
Roger Whitcomb commented on PIVOT-980:
--------------------------------------
Hi Josh, I'm looking at this (finally, after the holidays, etc.) and I have a
couple of questions:
* When you see the need for horizontal/vertical alignment, do you have
scrollbars showing?
* What is the scrollbar policy you are using?
* If there are scrollbars, could you simply set the scroll yourself such that
the image is centered?
* Even if there are not scrollbars, can you try setting the "scrollLeft" and
"scrollTop" values anyway and see if this accomplishes what you want?
Thanks.
> ScrollPane horizontal and vertical alignment of content
> -------------------------------------------------------
>
> Key: PIVOT-980
> URL: https://issues.apache.org/jira/browse/PIVOT-980
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0.4
> Environment: Win 7 x64, Java 7
> Reporter: Josh Highley
> Assignee: Roger Whitcomb
> Priority: Minor
>
> I'm opening this request per Roger based on a Pivot user mailing list
> exchange beginning November 30 2015:
> When the contents of a ScrollPane are smaller than the dimensions of the
> ScrollPane, there doesn't seem to be a way (or an easy way) to make the
> content be centered. The content is always aligned top-left. Using nested
> BoxPanes for vertical and horizontal alignment doesn't work since the
> BoxPanes don't expand to fill the ScrollPane, despite fill:true.
> I propose adding support for verticalAlignment and horizontalAlignment to the
> ScrollPane for when its content is small than its dimensions:
> <ScrollPane styles="{verticalAlignment:'center',
> horizontalAlignment:'center'}">
> <ImageView ... />
> </ScrollPane>
> This is my initial mailing list message:
> ======================================================
> I need help getting an image to display centered inside a larger ScrollPane.
> My application displays an image that can be zoomed in and out. A snippet of
> my current bxml is below. I adjust the zoom by changing the dimensions of
> the Border container. When the border is zoomed out such that it is smaller
> than the ScrollPane size, it's aligning to the top-left. I'd like to center
> it vertically and horizontally. I've tried various combinations of
> TablePane, FillPane and BoxPane as parents of the Border. BoxPane with
> fill:true (maybe nested BoxPanes with opposite orientations) isn't expanding
> to fill the ScrollPane as I'd expect; It shrinks to the size of the
> Border/Image
> <ScrollPane>
> <Border>
> <ImageView styles="{fill: true}"/>
> </Border>
> </ScrollPane>
> ======================================================
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)