13
0
Commit Graph

896 Commits

Author SHA1 Message Date
e88a121ff8
Fix canvas rectangle bounding box
When drawing the outline of a rectangle, the bounding
box must cover the whole pixel of the line. Otherwise
the line would be left behind when the rectangle shrinks.
2023-09-07 02:45:26 +02:00
845600b261 fix off-by-one pixel error caused by using floor() instead of round() 2023-08-26 10:07:41 -06:00
4c845eb2a0 cairo single pixel line offset fix, part 1 2023-07-17 20:54:33 -06:00
3ab3ef3b55
Fix lineset drawing (again), apply cairo 0.5px offset
see also f08299ea1e
2023-07-17 23:28:36 +02:00
f08299ea1e
Fix lineset drawing for lines > 1px width
This is a follow up to 248e37ac0c.

A line at 0 with 1px width should draw from 0.5 to 1.5
(cairo pixel offset). The same line with a width of 3px
is -0.5 to 2.5.

The self.intersection code calculates this correctly, subtracting
shift, the drawing code however incorrectly added it.

This fixes MIDI track grid/note offset as well as a bleed
below the track.
2023-07-17 05:05:20 +02:00
de67226c90 provide PolyItem::pop_back() 2023-07-09 20:41:36 -06:00
91500795d8 canvas: extend PolyItem API with ::add_point() 2023-06-26 14:18:18 -06:00
8a204bcf51 lollis: draw stems in fill color (optionally) 2023-06-26 14:18:18 -06:00
a6c1a3d9d0 lollis: potentially clip circle with a bounding parent 2023-06-26 14:18:18 -06:00
96c9f2ee19 canvas: add velocity() method to Note 2023-06-26 14:18:18 -06:00
279e648a43 canvas: ArdourCanvas::Lollipop to not (mis)use _position 2023-06-26 14:18:18 -06:00
a7af6fc6f8 lollipops: just directly set _position member 2023-06-26 14:18:17 -06:00
1ad0894618 lollipops should render child items (currently none) 2023-06-26 14:18:17 -06:00
51e7584dee another use of auto iterators 2023-06-26 14:18:17 -06:00
cfbe6b6048 another use of auto iterators 2023-06-26 14:18:17 -06:00
f7e97be115 canvas lollipops: object redesign and reimplementation 2023-06-26 14:18:17 -06:00
0f611b4efa C++ auto iteration FTW 2023-06-26 14:18:17 -06:00
7e4a3dce01 lollipop pixel pushing 2023-06-26 14:18:17 -06:00
4bafadc419 steps to an ecology of lollipops 2023-06-26 14:18:17 -06:00
0b050c47e4 build lollipops.cc 2023-06-26 14:18:17 -06:00
187569dcbc new Lollipop canvas item 2023-06-26 14:18:17 -06:00
7dc9bf157b fix measure line drawing (convert to window coords for intersection check) 2023-06-16 09:16:53 -06:00
248e37ac0c canvas LineSet: fix rendering to get coordinates precisely correct 2023-06-15 20:10:32 -06:00
a7c4ab3247 fix thinko in canvas logic (fixes mouse cursor on desensitized playhead) 2023-05-01 08:49:27 -05:00
03b4635bea
Fix a small memory leak 2023-04-19 14:20:48 +02:00
a1e9dfb672 canvas lineset: C++11-ification 2023-04-10 09:18:44 -06:00
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
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
edca8209aa canvas: fix debug output after auto-fication 2023-03-24 14:19:16 -06:00
3036414e08 tempo: auto-fication of another loop 2023-03-24 14:19:16 -06:00
37cae2f971 canvas: when an item is shown, potentially pick it as the current item 2023-03-24 14:19:16 -06:00
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
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
5ee7941895 Only use render-group when container is not opaque 2023-02-05 22:34:38 +01:00
509504acf2 Add API to set openGL backing scale 2023-02-04 22:25:52 +01:00
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
8359311849 debug: allow to profile exposure (revert this later) 2023-02-01 19:41:11 +01:00
b7ac434584 canvas: invalidate scrollgroup, request redraw after scrolling 2023-02-01 02:57:10 +01:00
902b98588e canvas: profile render time / area 2023-02-01 01:25:27 +01:00
f377822891 (temporarily) add nodraw bitflag to avoid gradient fills 2023-01-24 10:01:04 -07:00
859d6ebe4a debug: log canvas exposure area 2023-01-21 17:36:22 +01:00
4cd7de7a6f debugging: allow selection no-draw for canvas fill, outline, text, lineset and waveview 2023-01-20 18:13:12 -07:00
3ae7295142
Allow to disable cairo render groups (performance test) 2023-01-06 21:15:43 +01:00
ab34861388 canvas: provide a means of blocking change notifications from Item propagating up the object tree 2022-12-10 13:37:16 -07:00
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
e3dc0a24f2 canvas ruler: use second font description appropriately 2022-11-29 10:09:39 -07:00
34e7c2ffc5
Remove cruft (unused CANVAS_COMPATIBILITY - 1/3) 2022-11-19 21:49:01 +01:00
0ef10e4f5f canvas: ruler never shows marks/text for points too close to display the label 2022-10-31 17:05:55 -06:00
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