13
0
livetrax/libs/canvas
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
..
benchmark NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
canvas canvas: make "debug_render" into a per-canvas member variable 2022-09-03 16:46:41 -06:00
doc initial commit of hand merging, plus getting "ancient" waf script to work correctly 2013-04-04 00:32:52 -04:00
MSVCcanvas Adapt our remaining MSVC projects for 'boost::atomic' (in case it later gets extended to the other libs) 2018-09-30 09:19:28 +01:00
test remove Kiwi constraint-based packing code from canvas library and users (library version) 2021-11-04 11:25:30 -06:00
arc.cc canvas: tweaks to Arc canvas item 2022-08-27 12:54:43 -06:00
arrow.cc canvas: change Item::bb_clean() to better named Item::set_bbox_clean() 2022-04-26 22:04:08 -06:00
box.cc canvas: improve debug trace output during Box::reposition_children() 2022-09-03 16:46:41 -06:00
build-and-run-benchmark.sh initial commit of hand merging, plus getting "ancient" waf script to work correctly 2013-04-04 00:32:52 -04:00
build-and-run-manual-test.sh initial commit of hand merging, plus getting "ancient" waf script to work correctly 2013-04-04 00:32:52 -04:00
build-and-run-tests.sh initial commit of hand merging, plus getting "ancient" waf script to work correctly 2013-04-04 00:32:52 -04:00
canvas.cc canvas: make "debug_render" into a per-canvas member variable 2022-09-03 16:46:41 -06:00
circle.cc Update canvas/UI lib GPL boilerplate and (C) from git log 2019-08-03 15:53:17 +02:00
container.cc canvas: change Item::bb_clean() to better named Item::set_bbox_clean() 2022-04-26 22:04:08 -06:00
ct Canvas: tweak test script runner 2021-08-13 12:51:26 -06:00
curve.cc Fix various typos in libs/canvas 2022-08-03 12:07:46 -06:00
debug.cc canvas: add Table debug bit 2021-09-14 18:29:39 -06:00
fill.cc NOOP: remove whitespace 2021-08-13 12:51:25 -06:00
flag.cc Update canvas/UI lib GPL boilerplate and (C) from git log 2019-08-03 15:53:17 +02:00
framed_curve.cc Fix various typos in libs/canvas 2022-08-03 12:07:46 -06:00
grid.cc canvas: change Item::bb_clean() to better named Item::set_bbox_clean() 2022-04-26 22:04:08 -06:00
image.cc canvas: change Item::bb_clean() to better named Item::set_bbox_clean() 2022-04-26 22:04:08 -06:00
item.cc canvas: do not strip layout-sensitivity when adding items to a container 2022-09-03 16:46:41 -06:00
line_set.cc canvas: change Item::bb_clean() to better named Item::set_bbox_clean() 2022-04-26 22:04:08 -06:00
line.cc canvas: change Item::bb_clean() to better named Item::set_bbox_clean() 2022-04-26 22:04:08 -06:00
lookup_table.cc canvas; remove already-commented debug output 2021-08-13 12:51:37 -06:00
meter.cc canvas: NOOP - meter, whitespace adjustment 2022-09-03 16:46:41 -06:00
note.cc use selected (outline) color for MIDI note velocity bar (thanks, cooltehno, for the idea) 2022-08-31 13:53:43 -06:00
Notes initial commit of hand merging, plus getting "ancient" waf script to work correctly 2013-04-04 00:32:52 -04:00
outline.cc canvas: when an item has its bbox marked dirty, this should propagate to all parents 2022-04-26 22:04:08 -06:00
pixbuf.cc canvas: change Item::bb_clean() to better named Item::set_bbox_clean() 2022-04-26 22:04:08 -06:00
poly_item.cc canvas: change Item::bb_clean() to better named Item::set_bbox_clean() 2022-04-26 22:04:08 -06:00
poly_line.cc Fix mouse events on clamped automation lines 2022-10-17 00:09:25 +02:00
polygon.cc canvas: when an item has its bbox marked dirty, this should propagate to all parents 2022-04-26 22:04:08 -06:00
rectangle.cc canvas: change Item::bb_clean() to better named Item::set_bbox_clean() 2022-04-26 22:04:08 -06:00
root_group.cc Remove 18 month old debug messages 2022-02-01 22:01:41 +01:00
ruler.cc ruler: make ::set_metric() API consistent with constructor by using ptr 2021-12-24 15:34:18 -07:00
run-manual-test.sh initial commit of hand merging, plus getting "ancient" waf script to work correctly 2013-04-04 00:32:52 -04:00
run-tests.sh initial commit of hand merging, plus getting "ancient" waf script to work correctly 2013-04-04 00:32:52 -04:00
scroll_group.cc Prevent rendering outside of canvas scroll groups 2022-07-06 20:50:03 +02:00
stateful_image.cc Update canvas/UI lib GPL boilerplate and (C) from git log 2019-08-03 15:53:17 +02:00
step_button.cc canvas: change Item::bb_clean() to better named Item::set_bbox_clean() 2022-04-26 22:04:08 -06:00
table.cc Fix various typos in libs/canvas 2022-08-03 12:07:46 -06:00
text.cc canvas: change Item::bb_clean() to better named Item::set_bbox_clean() 2022-04-26 22:04:08 -06:00
tracking_text.cc Fix tracking-text offset 2020-12-30 03:26:00 +01:00
types.cc canvas; change operator<<() for Rect to show BIG instead of gigantic 64 bit numbers 2021-08-13 12:51:36 -06:00
utils.cc Update canvas/UI lib GPL boilerplate and (C) from git log 2019-08-03 15:53:17 +02:00
widget.cc canvas: change Item::bb_clean() to better named Item::set_bbox_clean() 2022-04-26 22:04:08 -06:00
wscript wscript: consistently have at most one empty separator line 2022-04-09 12:16:40 +02:00
xfade_curve.cc canvas: change Item::bb_clean() to better named Item::set_bbox_clean() 2022-04-26 22:04:08 -06:00