You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Josh Highley (JIRA)" <ji...@apache.org> on 2016/01/19 19:36:39 UTC

[jira] [Comment Edited] (PIVOT-980) ScrollPane horizontal and vertical alignment of content

    [ https://issues.apache.org/jira/browse/PIVOT-980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15107149#comment-15107149 ] 

Josh Highley edited comment on PIVOT-980 at 1/19/16 6:35 PM:
-------------------------------------------------------------

Attached 'ScrollPane Test.zip'.  Run ScrollPaneBasic.  setScrollTop and setScrollLeft are handled in ScrollPaneBasicWindow, along with a nasty hack that I didn't need in my actual app.  My real application loads a larger image, but sizes it smaller for a Zoom Out feature.  


was (Author: joshhighley):
Run ScrollPaneBasic.  setScrollTop and setScrollLeft are handled in ScrollPaneBasicWindow, along with a nasty hack that I didn't need in my actual app.  My real application loads a larger image, but sizes it smaller for a Zoom Out feature.  

> 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
>         Attachments: ScrollPane Test.zip
>
>
> 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)