Bubbles3/Controls/BblImageSurface.cs
/// <summary>
///-Adapts the matrices so the image is constrained to stay 
///inside the client and prevented to be zoomed into oblivion
///-Computes the scroll indicator position
///-Requests a redraw.
/// </summary>
Adapts the matrices so the image is constrained to stay
inside the client and prevented to be zoomed into oblivion
Computes the scroll indicator position
Requests a redraw.
Adapts the matrices so the image is constrained to stay inside the client and prevented to be zoomed into oblivion Computes the scroll indicator position Requests a redraw .
protected void UpdateRenderParams(bool noInvalidate = false)
        {
            if (_img != null)
            {
                RectangleF imgRect;
                float radius = 6f;
                ConstraintTransforms(ref _rotation, ref _scale, ref _translation, out imgRect);
                if ((imgRect.Height <= ClientSize.Height) || !P.showScroll)
                {
                    float pos = _scrollingUp ? radius : ClientSize.Height - radius;
                    _scrollIndicator = new Vector2(ClientSize.Width - radius, pos);
                }
                else
                {
                    float top = imgRect.Y + (ClientSize.Height / 2);                    
                    float bot = (imgRect.Y + imgRect.Height) - (ClientSize.Height / 2);   
                    float pos = radius + (((ClientCenter.Y - top) / (bot - top)) * (ClientSize.Height - radius));
                    if (pos < radius) pos = radius;
                    else if (pos > ClientSize.Height - radius) pos = ClientSize.Height - radius;
                    _scrollIndicator = new Vector2(ClientSize.Width - radius, pos);
                }
                RectangleF rect = new RectangleF(0, 0, _img.PixelSize.Width, _img.PixelSize.Height);
                TransformedBounds(imgRect, out rect, _scale);
            }
            if (!noInvalidate) Invalidate();
        }
protected void UpdateRenderParams ( bool noInvalidate = false ) { if ( _img != null ) { RectangleF imgRect ; float radius = 6f ; ConstraintTransforms ( ref _rotation , ref _scale , ref _translation , out imgRect ) ; if ( ( imgRect . Height <= ClientSize . Height ) || ! P . showScroll ) { float pos = _scrollingUp ? radius : ClientSize . Height - radius ; _scrollIndicator = new Vector2 ( ClientSize . Width - radius , pos ) ; } else { float top = imgRect . Y + ( ClientSize . Height / 2 ) ; float bot = ( imgRect . Y + imgRect . Height ) - ( ClientSize . Height / 2 ) ; float pos = radius + ( ( ( ClientCenter . Y - top ) / ( bot - top ) ) * ( ClientSize . Height - radius ) ) ; if ( pos < radius ) pos = radius ; else if ( pos > ClientSize . Height - radius ) pos = ClientSize . Height - radius ; _scrollIndicator = new Vector2 ( ClientSize . Width - radius , pos ) ; } RectangleF rect = new RectangleF ( 0 , 0 , _img . PixelSize . Width , _img . PixelSize . Height ) ; TransformedBounds ( imgRect , out rect , _scale ) ; } if ( ! noInvalidate ) Invalidate ( ) ; }
Adapts the matrices so the image is constrained to stay
inside the client and prevented to be zoomed into oblivion
Computes the scroll indicator position
Requests a redraw.
Adapts the matrices so the image is constrained to stay inside the client and prevented to be zoomed into oblivion Computes the scroll indicator position Requests a redraw .
//position of the scrollIndicator //image top y coord //image bottom y coord                    //y position of the scroll indicator
noInvalidate
bool