Commit graph

9 commits

Author SHA1 Message Date
Paul Davis
05a5bcc84c ScrollGroup::covers_{window,canvas}() need to account for possible non-zero position of the group.
They also do NOT need to consider scroll offset
2015-01-24 18:13:56 -05:00
Paul Davis
28fdc71d70 more canvas refactoring.
Remove Canvas::Layout, use Canvas::Container for the same purpose, move child-rendering into Item::render_children() so that it
could theoretically be used by any derived type.
2014-08-17 17:44:17 -04:00
Paul Davis
98aa604aa0 refactor Canvas so that all Items have children; add Container abstract base class; rename Group as "Layout" and retain only drawing semantics 2014-08-17 17:42:59 -04:00
Paul Davis
452cf1db35 change Canvas heirarchy and constructors
Items no longer need a parent group (they require a Canvas pointer instead), so all constructors have been rationalized
and have two variants, one with a parent and one with a canvas.

All Items now inherit from Fill and Outline, to banish diagonal inheritance and virtual base classes and all that.

There were zero changes to the Ardour GUI arising from these changes.
2014-08-17 15:08:56 -04:00
Paul Davis
874ac355e7 clip rendering of ScrollGroup to just the part of the canvas covered by the scroll group.
This stops tracks from appearing to scroll up under the rulers, among other things.
2014-08-17 14:50:12 -04:00
Paul Davis
e8e3460665 more profound changes to canvas scrolling, in particular find appropriate ScrollGroup for Canvas::{window,canvas}_to_{canvas,window}()
Conflicts:
	gtk2_ardour/editor_mouse.cc
2014-08-17 13:43:52 -04:00
Paul Davis
bed0c78432 various changes to get independent scrolling to work better in canvas. mostly tweaks relating to how scroll offsets are used during rendering.
Event handling offsets still require work.
2014-08-17 13:39:10 -04:00
Paul Davis
2b361eecec inline ScrollGroup::canvas_position() for no particular reason 2014-08-17 13:38:35 -04:00
Paul Davis
cb9453b475 different approach to independent scrolling, involving ArdourCanvas::ScrollGroup
The idea now is that a scroll group item can be added to the canvas which will causes its children to scroll in either or both
directions (horizontal or vertical). There are few complications: the position() of the ScrollGroup is ambiguous depending
on whether you want it with scroll taken into account or not, so Item::canvas_position() was added, which defaults to
the same value as Item::position() but is overridden by ScrollGroup to return the position independent of scrolling. This
method is used when translating between item/canvas/window coordinate systems.

Note that the basic idea is that we MOVE the scroll group when a scroll happens. This mirrors what happens in the GnomeCanvas,
where Nick Mainsbridge came up with a great idea that allowed unification of the time bar and track canvases.
2014-08-17 13:37:27 -04:00