[CREATE] Multiple viewports (for MyPaint, but Gimp/Krita/whoever too?)

Boudewijn Rempt boud at valdyas.org
Thu Jul 21 09:52:52 CEST 2011


On Wednesday 20 July 2011 Jul, Andrew Chadwick wrote:

> I can think of some places where MyPaint does things strangely in
> general, in all branches:
> 
> - View rotation is a number of radians ranging from 0 to 2*pi. It might
> be better to express as degrees or a float from 0 to 1.

I'm actually not sure how our view rotation is expressed -- but we don't save it either to .kra or to .ora yet. We also don't store the zoom settings or the mirror settings. It's a good idea, though.

> - View mirroring is a concept which may not be used in all other editors.

Krita supports that as well.

Krita also has split-view, but limited, like I said in another mail -- and I'm thinking of removing it. We used to have an overview widget, but that wasn't implemented as a low-zoom view -- it's something we want to revive.

Maybe this is a good moment to start thinking of what split view really should look like for Krita :-).

> 
> 
> Both of these affect the notion of what a view of the document is, but
> the split-screen implementation on my branch is somewhat funky too:
> 
>  - It's structured as a binary tree dividing space, which is horrible
> for other programs which might want to do this as multiple windows but
> fast to dump and recreate in terms of two-panel HPaneds and VPaneds.
> Leaf nodes are the views themselves. There's no reason this can't be
> made into a flat list that's more convenient for other ORA-consumers
> though, provided we can store the tree path to each viewport in a path
> or name field.
> 
>  - Each split is saved along with the position of the divider, expressed
> as a proportion of the total width (or height) of the screen. This gains
> us some window size-independence. Other implementations may want to save
> the sizes of their windows, or even their positions.
> 
>  - I use an enforced maximum number of viewports right now. Likely
> that's a fairly irrelevant implementation detail.
> 
> The nasty JSON dump inside the .ora will *almost certainly* go away as a
> result of this discussion; that's just a stopgap implementation and I
> don't intend to integrate it into the MyPaint master :)
> 

I'd be tempted to just save the rect of each subview with its rotation, mirror and zoom parameters. Going with the dividers is a bit implementation specific, I think.


-- 
Boudewijn Rempt
http://www.valdyas.org, http://www.krita.org, http://www.boudewijnrempt.nl


More information about the kimageshop mailing list