ajstarks / giocanvas

Canvas API built with Gio
Other
141 stars 14 forks source link

gcdeck: Re-scale slides when window is resized. #9

Closed andybalholm closed 1 year ago

andybalholm commented 1 year ago

The slides will resize to fill the new window size.

gedw99 commented 1 year ago

wondering if we shoudl expose it as an option on the args here: https://github.com/ajstarks/giocanvas/tree/master/gcdeck#options

then you can express resize there..

some people might want fixed size still.

andybalholm commented 1 year ago

There are probably more people who would want an option to keep the proportions, than who would want it to stay exactly the same size when the window is resized.

gedw99 commented 1 year ago

well, my use case is to have both resize and / or fixed.

currently its:

-pagesize string
        pagesize: w,h, or one of: Letter, Legal, Tabloid, A3, A4, A5, ArchA, 4R, Index, Widescreen (default "Letter")

propose:

-pagesize string
        pagesize: w,h, or one of: Letter, Legal, Tabloid, A3, A4, A5, ArchA, 4R, Index, Widescreen (default "Letter"), resizable 
andybalholm commented 1 year ago

That sounds like a good way to do it. But how would it pick the initial window size?

gedw99 commented 1 year ago

https://github.com/ajstarks/giocanvas/blob/48a62d59de5358c49d90c067f7be757e5037a456/gcdeck/gcdeck.go#L617

deck, err := readDeck(filename, width, height)

We need to feedback that current / session GIOUI window size back into that call so readDeck can recreate the xml that holds the absolute positions.

andybalholm commented 1 year ago

The code I have works without that. Maybe that would give more accurate positions, though. But we don't want to need to re-read the XML file on every frame…

gedw99 commented 1 year ago

I need to run the code then to see what your mean about positions.

I am going to raise another issue related to this - you jogged my memory..

ajstarks commented 1 year ago

See revision https://github.com/ajstarks/giocanvas/commit/b22c8db862c53b58bec44fbc3cd9383994a048cc

if you do not resize, the specified (or default) pagesize is used. If you resize the window, the deck is proportionally resized. No other command line option is required.