Page 1 of 1
Centering a ScaleRichView document...
Posted: Fri Nov 18, 2016 10:38 pm
by DXS
Hello again
Is it possible to keep a drawing centered (either vertically or both vertical and horizontally), though zooming/scaling? currently it seems to stay left.
If not an automatic method, I do assume that I can code an event to center on zoom?
Thanks,
Andy
Posted: Sat Nov 19, 2016 9:59 am
by Sergey Tkachenko
Do you mean drawing or scrolling?
As for scrolling, TSRichViewEdit tries to keep unmoved:
- the mouse pointer position (if it is inside its window)
- document at the window center (if the mouse pointer is outside the window)
Posted: Sat Nov 19, 2016 10:03 am
by Sergey Tkachenko
As for drawing, pages are drawn in an imaginary grid. The maximum count of columns in this page grid is defined in ViewPropoerty.MaxPageColCount (0 means unlimited.
The page is centered in the cell of this imaginary grid.
You can set MaxPageColCount = 1, pages will be always centered horizontally, but there will be not possible to display more than 1 page side to side.
You can also use ViewProperty.FreePosPage and OnGetPagePos event.
Posted: Sun Nov 20, 2016 10:43 pm
by DXS
Thank you, that worked
Is there a way to automatically keep the it vertically aligned as well?
Thanks again,
Andy
Posted: Thu Dec 01, 2016 6:16 pm
by Sergey Tkachenko
Currently, there is no option for centering (except for free page positioning).
We will considering adding an option.