Commit graph

871 commits

Author SHA1 Message Date
Paul Davis
a1e9dfb672 canvas lineset: C++11-ification 2023-04-10 09:18:44 -06:00
Paul Davis
4f87506e5c do not sort lineset every time a coord is added; use RAII to create scope and sort at end 2023-04-09 14:36:03 -06:00
Paul Davis
9e0c1ff510 Revert "canvas: when an item is shown, potentially pick it as the current item"
This reverts commit 37cae2f971.

This changes causes issues with recursive calls to the enter/leave event handling
stacks in gtk2_adour. Semantically, the change makes perfect sense, but finding
a solution to the recursion is challenging.
2023-03-30 09:54:56 -06:00
Paul Davis
edca8209aa canvas: fix debug output after auto-fication 2023-03-24 14:19:16 -06:00
Paul Davis
3036414e08 tempo: auto-fication of another loop 2023-03-24 14:19:16 -06:00
Paul Davis
37cae2f971 canvas: when an item is shown, potentially pick it as the current item 2023-03-24 14:19:16 -06:00
Paul Davis
b35518e212 switch from boost::{shared,weak}_ptr to std::{shared,weak}_ptr
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
2023-03-24 14:19:15 -06:00
Paul Davis
39ed528e25 std-ize: convert all boost shared/weak ptr includes to <memory>
Also fix stdint.h -> cstdint and alphabetically order std includes
2023-03-24 14:19:15 -06:00
Robin Gareus
5ee7941895 Only use render-group when container is not opaque 2023-02-05 22:34:38 +01:00
Robin Gareus
509504acf2 Add API to set openGL backing scale 2023-02-04 22:25:52 +01:00
Robin Gareus
d12dd4015d
Revert canvas debugging
This reverts commit 8359311849.
This reverts commit f377822891.
This reverts commit 859d6ebe4a.
This reverts commit 4cd7de7a6f.
2023-02-04 18:23:18 +01:00
Robin Gareus
8359311849 debug: allow to profile exposure (revert this later) 2023-02-01 19:41:11 +01:00
Robin Gareus
b7ac434584 canvas: invalidate scrollgroup, request redraw after scrolling 2023-02-01 02:57:10 +01:00
Robin Gareus
902b98588e canvas: profile render time / area 2023-02-01 01:25:27 +01:00
Paul Davis
f377822891 (temporarily) add nodraw bitflag to avoid gradient fills 2023-01-24 10:01:04 -07:00
Robin Gareus
859d6ebe4a debug: log canvas exposure area 2023-01-21 17:36:22 +01:00
Paul Davis
4cd7de7a6f debugging: allow selection no-draw for canvas fill, outline, text, lineset and waveview 2023-01-20 18:13:12 -07:00
Robin Gareus
3ae7295142
Allow to disable cairo render groups (performance test) 2023-01-06 21:15:43 +01:00
Paul Davis
ab34861388 canvas: provide a means of blocking change notifications from Item propagating up the object tree 2022-12-10 13:37:16 -07:00
Robin Gareus
70b00f5201
Canvas: allow to group rendering of child items
> This group functionality can be convenient for performing
> intermediate compositing. One common use of a group is to
> render objects as opaque within the group, (so that they
> occlude each other), and then blend the result with
> translucence onto the destination.
https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-push-group

The main use case where will be to render opaque layered
[MIDI] regions transparently onto a grid.
2022-12-10 02:37:04 +01:00
Paul Davis
e3dc0a24f2 canvas ruler: use second font description appropriately 2022-11-29 10:09:39 -07:00
Robin Gareus
34e7c2ffc5
Remove cruft (unused CANVAS_COMPATIBILITY - 1/3) 2022-11-19 21:49:01 +01:00
Paul Davis
0ef10e4f5f canvas: ruler never shows marks/text for points too close to display the label 2022-10-31 17:05:55 -06:00
David Robillard
bdacfb8724 Fix invalid use of Doxygen "@param" command
This is never for inline references to parameters, only for starting parameter
documentation blocks.  The "@p" command is for this, although unfortunately
Doxygen doesn't actually do anything with it and it's just an alias for code
text.
2022-10-30 20:44:28 -04:00
Mads Kiilerich
0b27d6e652
Fix proximity threshold for polyline
I'm not good with a mouse, so I found it hard to edit animation lines.
The mouse position has to be quite precise, with only a small threshold.

Looking at the code, AutomationLine sets the threshold for the PolyLine
to 4.0 . That seems to be a distance, and better for me than what I
experience.

The actual code in PolyLine is however comparing it directly to the
squared distance, making it more sensitive than expected.

Fixed by computing the squared threshold - also including the line
width.
2022-10-17 00:09:25 +02:00
Mads Kiilerich
d1265b5a02
Fix mouse events on clamped automation lines
This fixes the following problem:
When automation lines with significant change are zoomed in time, the
slope gets smaller (towards horizontal) as the control points moves
further away from the visible area. That was rendered correctly, but the
corresponding mouse events happened as if the line had a steeper slope.

The problem was caused by the X value being clamped to the visible area,
without scaling the Y value correspondingly. It has apparently been like
that for a decode, since introduced in c4f0063a68.

The problem is fixed by introducing a clamp2 function that scales the Y
value if clamping the X value.

Note: An old comment says that math goes wrong unless clamping below
COORD_MAX. It is not clear to me what math it refers to, and especially
why we don't need similar clamping on the lower bounds.

And while rarely a real problem, I guess it would be more correct and a
slight optimization to skip all lines where both ends are outside the
same bound. In theory, as it is now, the mouse could catch an invisible
line close to the border.
2022-10-17 00:09:25 +02:00
Paul Davis
f13c4d1264 canvas: NOOP - meter, whitespace adjustment 2022-09-03 16:46:41 -06:00
Paul Davis
e5bf2b7ee8 canvas: style, using braces with conditional 2022-09-03 16:46:41 -06:00
Paul Davis
2313e3d333 canvas: meter bounding box does not rely on being on a canvas 2022-09-03 16:46:41 -06:00
Paul Davis
b2ce5f0616 canvas: do not strip layout-sensitivity when adding items to a container 2022-09-03 16:46:41 -06:00
Paul Davis
384530984a canvas: make "debug_render" into a per-canvas member variable
This allows us to debug rendering in specific canvases, rather
than all of them.
2022-09-03 16:46:41 -06:00
Paul Davis
36663210c9 canvas: improve debug trace output during Box::reposition_children() 2022-09-03 16:46:41 -06:00
Paul Davis
02b05f295a use selected (outline) color for MIDI note velocity bar (thanks, cooltehno, for the idea) 2022-08-31 13:53:43 -06:00
Paul Davis
a1f69ee63b canvas: tweaks to Arc canvas item
Cairo uses 0 degrees to mean "east", so the "top" or "north" of
a circle is actually -90 degrees
2022-08-27 12:54:43 -06:00
Paul Davis
5a0019f9a6 canvas: comment out unimplemented method 2022-08-03 12:08:57 -06:00
luz paz
36226cfd0a Fix various typos in libs/canvas 2022-08-03 12:07:46 -06:00
Robin Gareus
87d17f6624
Prevent rendering outside of canvas scroll groups
This fixes automation lanes bleeding into the ruler area.

The bounding box of all items in the main canvas group starts
at -0.5, and the cursor-scroll-group at -1.5. This is calculated
to include line-width, and outlines outside the item(s).

A scroll-group however must not extend its render area to
render those.
2022-07-06 20:50:03 +02:00
Paul Davis
45403dd2f1 fix may-be-used-unset warning 2022-06-22 13:31:08 -06:00
Paul Davis
ae9c11fb01 fix redefined CANVAS_DEBUG warning 2022-06-21 17:35:01 -06:00
Paul Davis
670b1fe3e2 fix initialization order warning 2022-06-21 17:34:48 -06:00
Paul Davis
ef07fb601a libcanvas: FramedCanvas::covers() method is ill-conceived. Use PolyItem::covers() 2022-05-29 14:19:02 -06:00
Paul Davis
f913373351 canvas: change Item::bb_clean() to better named Item::set_bbox_clean() 2022-04-26 22:04:08 -06:00
Paul Davis
c75ceb31ab canvas: when an item has its bbox marked dirty, this should propagate to all parents 2022-04-26 22:04:08 -06:00
Paul Davis
d54d63da3a canvas: remove code long disabled via an "if (0" 2022-04-26 22:04:08 -06:00
Mads Kiilerich
49855e52aa wscript: consistently have at most one empty separator line 2022-04-09 12:16:40 +02:00
Mads Kiilerich
c3bdcdd3fa wscript: consistently use space indentation instead of tab indentation 2022-04-09 12:16:40 +02:00
Mads Kiilerich
06f8936a73 wscript: remove trailing whitespace 2022-04-09 12:16:37 +02:00
luz paz
fb55878375
Fix source typos (heirarchy->hierarchy) 2022-04-08 21:38:00 +02:00
Mads Kiilerich
cb4e10683d
gtkmm: use size_request() function instead of deprecated Gtk::Widget::size_request(&) 2022-04-08 21:11:07 +02:00
Mads Kiilerich
91b08d5f45
gtkmm: use get_realized() instead of deprecated Gtk::Widget::is_realized() 2022-04-08 20:20:32 +02:00