13
0
Commit Graph

109 Commits

Author SHA1 Message Date
ef9bf58359 fix problems with expose/redraws from canvas where requested area goes way outside the integer range allowed by GTK/GDK 2014-06-05 14:42:46 -04:00
e0533e9dd7 more profound changes to canvas scrolling, in particular find appropriate ScrollGroup for Canvas::{window,canvas}_to_{canvas,window}() 2014-06-03 16:13:12 -04:00
d4989ed9ce fix missing leftover Canvas::pick_current_item() which was confusing button release event coordinates 2014-06-03 16:12:00 -04:00
073df89c4d use window-based coordinates when picking current item so that we get per-item (per-scroll-group,really) computation of position and coverage. 2014-06-03 16:12:00 -04:00
54a56cd3c6 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-06-03 16:12:00 -04:00
c9f890bd7c avoid recursing through the entire canvas when scrolling - only scroll explicitly identified ScrollGroups 2014-06-03 16:10:27 -04:00
6019f06bdf 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-06-03 16:10:27 -04:00
97109672c7 initial redesign of canvas scrolling to facilitate independent x- and y-axis scrolling of specific groups within the canvas.
This commit should cause no change in behaviour, but contains all the code and changes necessary
for the next step
2014-06-03 16:09:06 -04:00
fed5599baa smooth visual curve drawing 2014-05-30 03:04:02 +02:00
c2946ee00f don't queue redraws when various canvas item properties are "reset" to the same value, plus supporting functions 2014-03-11 07:36:09 -04:00
a08c0ea1da manually revert change to canvas expose handling in fee026c5ef
Breaking out the rectangles implies a z-axis ordering of drawing,because the rect drawn last will implicitly be "on top".
But redraw areas are not submitted with any z-axis information, and so drawing like this breaks canvas layering. It
would be more efficient to draw the rects separately, but we don't have any ordering information and so we cannot do it
correctly.
2014-03-05 13:12:18 -05:00
fee026c5ef break down GdkEventExpose into distinct rectangles for canvas expose rather than drawing the entire region as a single rect 2014-03-04 21:58:16 -05:00
0cbf8f7dea fix canvas enter/leave bug when point is over a group/ignore-event item and we fail to send a leave event to the previous item 2014-02-25 16:08:36 -05:00
f9a3e7f8bb add DEBUG::CanvasEnterLeave to allow runtime toggling of canvas enter/leave events 2014-02-25 16:07:51 -05:00
a329a44cc1 when delivering canvas events, if an item is grabbed, use it in preference to Canvas::_current_item, but still propagate to its ancestors if left unhandled 2014-02-11 22:49:10 -05:00
3c5a870289 a better, more general fix for the previous Canvas::item_going_away() issue. There is no need to repick the current item if the item going away is NOT the current item 2014-01-20 10:59:44 -05:00
2691209050 When removing an item which is event-insensitive, there is no need to repick the current item, since it can never have been used as the current item.
This fixes crashes associated with ghost notes in midi regions.
2014-01-20 10:53:58 -05:00
620e1e6677 add event type string function to canvas (since it does not use gtkmm2ext) 2014-01-16 10:52:34 -05:00
9df593d823 clamp expose (queue_redraw()) requests to visible window area, some extra debugging details 2014-01-10 14:35:36 -05:00
ffdf3ed017 don't go through ::deliver_enter_leave() unnecessarily 2014-01-10 11:02:05 -05:00
a70edc5765 change rounding used for convert Rect from canvas to window coordinates 2014-01-08 10:31:14 -05:00
98dec658ee Revert "remove unused code"
This reverts commit 2d283c17e1.
2014-01-08 10:29:03 -05:00
2d283c17e1 remove unused code 2014-01-08 10:28:46 -05:00
2d50adaf3a ignore invisible items when picking the current item
Also left behind some commented debug out that probably deserves a new PBD::Debug bit.
2013-12-30 14:02:43 -05:00
84f55440a3 fix redrawing of canvas with an optimized build
Best guess right now is that optimization does something bad when ceil() is called twice on a very large dbl-precision number,
which results in a zero (empty) redraw area. Without the removal of the redundant ceil & floor functions, no expose events
would be delivered to the canvas in an optimized build during drags (and maybe more).
2013-12-23 15:35:49 -05:00
9b6135b2e1 change enter/exit event delivery to follow X Window model (inferior, ancestor, virtual, nonlinear) 2013-12-12 20:44:04 -05:00
88732abd01 change event propagation to be based on parent/child lineage, not z-axis stacking, plus some more alterations to try to get enter/leave working 2013-12-12 10:03:33 -05:00
4780c84252 debug trace tweaks 2013-12-09 13:38:22 -05:00
6473cc7cb4 drop use of bounding box to determine whether an item covers a point; add Item::covers(Duple const&)
Default implementation for Item still uses bounding box, but specializations for Arc (Circle), Polygon, Line and PolyLine have been added
2013-11-04 11:56:10 -05:00
08b485db75 send enter events to EVERY newly entered item (ignore the bool return from the event handler); other canvas debugging aids;switch items_at_point() to use canvas coordinates 2013-11-03 10:07:00 -05:00
85daa31ab5 all events propagate out of the canvas in canvas coordinates now, so revert changes in editor_drags.cc that worked around this not being the case 2013-10-31 16:43:35 -04:00
b46244d527 finally (?) fix up logic for rectangle drawing (fill+stroke) to tackle what is hopefully the last of the expose problems 2013-10-31 11:49:36 -04:00
7ce86cec7d handle enter/leave items when zooming and scrolling occur 2013-10-31 03:10:18 -04:00
7bbd28aa08 notable changes to try to improve most of enter/leave handling for canvas items 2013-10-30 23:36:30 -04:00
006ba7cd36 reduce verbiage and remove visible current_item red rect 2013-10-28 16:36:11 -04:00
0db7bdface streamline button press event handling code a little, and tweak enter/leave debugging text 2013-10-28 12:25:41 -04:00
c3f1369cfd expand bounding box of all objects by 0.5 before computing intersection for render cycle; alter debug output 2013-10-24 17:14:12 -04:00
18850253e9 only generate some current canvas debug output when CANVAS_DEBUG is defined, to quieten things down 2013-09-25 10:38:04 -04:00
741154e691 debugging various canvas event issues 2013-08-08 15:26:42 -04:00
a1f858d3b2 an awful lot of tweaks to drawing details 2013-06-24 16:28:53 -04:00
691be68ac2 fix rect redraw problems caused by intersection requiring the usual 0.5 expansion (though consider a more general fix for this at teh group level) 2013-06-18 13:46:24 -04:00
77f5f4c4bf basically operational switch to canvas drawing coordinates, although text and waves don't work, and redraw areas are too small 2013-06-18 08:23:06 -04:00
f8a37b197f tweak enter/leave code, remove debug output 2013-04-25 09:49:02 -04:00
d0867e67e3 more tweaks for enter/leave events for canvas items 2013-04-24 22:57:23 -04:00
737433c446 tweaks to improve enter/leave event handling - fixes at least some crashes caused by this stuff 2013-04-24 18:31:00 -04:00
6f664c1f67 many pervasive changes primarily related to waveform drawing, particular content-dragging, colors, and more 2013-04-24 15:42:14 -04:00
9a3bc39970 tweak event/leave event delivery so that it applies to items being deleted as well as motion events (hmm, needed for item addition too ...) 2013-04-20 16:11:40 -04:00
ec102f94e1 various work waveview amplitude mgmt; fix playhead cursor drag from timebar click 2013-04-17 15:22:09 -04:00
d1a05240ef fix clamping of line and rect coordinates to avoid issues with cairo when drawing way outside a surface's dimensions; move various coordinate methods down to Canvas, because they don't require GTK information; make visible_area() a Canvas virtual method so that we don't have to cast to call it 2013-04-17 10:53:17 -04:00
a0044e5f71 add back various functionality to waveviews such as zero line, amplitude scaling 2013-04-16 10:07:52 -04:00
64d3763652 remove all xml++.h inclusion by canvas implementations 2013-04-15 22:00:13 -04:00
84fb0a8dce remove all XML related API from canvas. it may have been useful during development, but it is just a distraction - we will NEVER be saving or restoring canvas state via XML or any kind of serialized state 2013-04-15 21:57:08 -04:00
af4539f857 a few changes to fix region dragging, all related to coordinate system handling, which is now much simpler with the new canvas; more debugging output when asked for 2013-04-15 10:38:12 -04:00
ee1f0520a8 many changes to get the cairo-canvas version much, much more functional. still problems with a lot of subtle and not-so-subtle issues 2013-04-11 20:19:22 -04:00
75118796e1 add -D canvasevents tracing for grabbed items and remove render count output 2013-04-10 11:09:16 -04:00
053eaf77fd a variety of fixes for the cairocanvas, but it still buggy as hell handling events and lots of other stuff 2013-04-09 14:22:58 -04:00
1267b1d61c mo' better debugging of canvas "structure" via Item::dump and derivatives 2013-04-08 19:48:09 -04:00
07a505b1b2 lots of tweaking and adding debug output including operator<</dump(ostream&) methods to help visualize canvas structure 2013-04-05 11:27:26 -04:00
aaea166135 initial commit of hand merging, plus getting "ancient" waf script to work correctly 2013-04-04 00:32:52 -04:00