How can I redraw my degraph background on scrolling?

I am using canvas with degrafa background so nice.

However, when scrolling, the background (grid of degraphs) is not redrawn. In the code, background strokes are associated with the height of the container. The height of the container does not change even when scrolling.

How do I get the height of the entire area so that I can set a new height to my degrafa level?

It looks like this:

degrafa background example

 <mx:Canvas id="blackBoard"
                width="100%" 
                height="100%" 
                x="0" 
                y="0" 
                backgroundColor="#444444"
                clipContent="true">

    <!-- Degrafa Surface   -->
    <degrafa:Surface id="boardSurfaceContainer">
            <degrafa:strokes>
                <degrafa:SolidStroke    id="whiteStroke"
                                        color="#EEE"
                                        weight="1"
                                        alpha=".2"/>
            </degrafa:strokes>

            <!-- Grid drawing -->
            <degrafa:GeometryGroup id="grid">
                <degrafa:VerticalLineRepeater   count="{blackBoard.width / ApplicationFacade.settings.GRID_SIZE}"
                                                stroke="{whiteStroke}"
                                                x="0"
                                                y="0"
                                                y1="{blackBoard.height}"
                                                offsetX="0"
                                                offsetY="0"
                                                moveOffsetX="{ApplicationFacade.settings.GRID_SIZE}"
                                                moveOffsetY="0"/>

                <degrafa:HorizontalLineRepeater count="{blackBoard.height / ApplicationFacade.settings.GRID_SIZE}"
                                                stroke="{whiteStroke}"
                                                x="0"
                                                y="0"
                                                x1="{blackBoard.width}"
                                                offsetX="0"
                                                offsetY="0"
                                                moveOffsetX="0"
                                                moveOffsetY="{ApplicationFacade.settings.GRID_SIZE}"/>

            </degrafa:GeometryGroup>          

        </degrafa:Surface>

      

0


source to share


1 answer


I just needed to use the scroll position in the degrafa property binding



            <degrafa:VerticalLineRepeater   count="{(blackBoard.width + blackBoard.horizontalScrollPosition)/ ApplicationFacade.settings.GRID_SIZE}"
                                            stroke="{whiteStroke}"
                                            x="0"
                                            y="0"
                                            y1="{blackBoard.height + blackBoard.verticalScrollPosition}"
                                            offsetX="0"
                                            offsetY="0"
                                            moveOffsetX="{ApplicationFacade.settings.GRID_SIZE}"
                                            moveOffsetY="0"/>

      

0


source







All Articles