From 5b1dfe45345a32f46d62e8e44106565e83d409bb Mon Sep 17 00:00:00 2001
From: Ichthyostega
Date: Sat, 19 Jun 2021 17:06:12 +0200
Subject: [PATCH] Clip-Drag: further investigation and clean-up
Seems to work solid now, after switching to the root coordinates provided by GDK.
With local relative coordinates, the subject fidgets while being dragged,
for obvious reasons, since we're shifting the relative point of reference.
Also clarified a strange behaviour of the test drawing code:
Cairo is "turtle graphics", so we need to set the starting point explicitly.
---
.../interact/drag-relocate-controller.hpp | 16 +-
src/stage/timeline/body-canvas-widget.cpp | 3 +-
src/stage/timeline/clip-presenter.hpp | 7 +-
src/stage/timeline/timeline-layout.cpp | 3 +
src/stage/timeline/track-body.cpp | 4 +-
wiki/thinkPad.ichthyo.mm | 338 +++++++++++++++---
6 files changed, 311 insertions(+), 60 deletions(-)
diff --git a/src/stage/interact/drag-relocate-controller.hpp b/src/stage/interact/drag-relocate-controller.hpp
index 41d3760a2..6fd290057 100644
--- a/src/stage/interact/drag-relocate-controller.hpp
+++ b/src/stage/interact/drag-relocate-controller.hpp
@@ -159,8 +159,8 @@ namespace interact {
return false; // Event not handled by this controller
REQUIRE (motion_event);
std::cerr << _Fmt{"MOVE x=%3.1f y=%3.1f subject=%s"}
- % motion_event->x
- % motion_event->y
+ % motion_event->x_root
+ % motion_event->y_root
% subject
<< std::endl;
if (not isAnchored())
@@ -199,8 +199,8 @@ namespace interact {
{
REQUIRE (motion_event);
this->subject_ = & subject;
- this->anchorX_ = motion_event->x;
- this->anchorY_ = motion_event->y;
+ this->anchorX_ = motion_event->x_root;
+ this->anchorY_ = motion_event->y_root;
std::cerr << _Fmt{"ANCHOR at x=%3.1f y=%3.1f ('%s')"}
% anchorX_
% anchorY_
@@ -211,8 +211,8 @@ namespace interact {
void
probeActivation (GdkEventMotion* motion_event)
{
- isInFormation_ = DISTANCE_THRESHOLD < abs (motion_event->x - anchorX_)
- or DISTANCE_THRESHOLD < abs (motion_event->y - anchorY_);
+ isInFormation_ = DISTANCE_THRESHOLD < abs (motion_event->x_root - anchorX_)
+ or DISTANCE_THRESHOLD < abs (motion_event->y_root - anchorY_);
}
void
@@ -225,8 +225,8 @@ namespace interact {
doTrackGesture (GdkEventMotion* motion_event)
{
REQUIRE (motion_event);
- gdouble deltaX = motion_event->x - this->anchorX_;
- gdouble deltaY = motion_event->y - this->anchorY_;
+ gdouble deltaX = motion_event->x_root - this->anchorX_;
+ gdouble deltaY = motion_event->y_root - this->anchorY_;
// notify Subject to feed current delta
observer_->updateOffset (deltaX, deltaY);
}
diff --git a/src/stage/timeline/body-canvas-widget.cpp b/src/stage/timeline/body-canvas-widget.cpp
index fd2872d27..f6de3832a 100644
--- a/src/stage/timeline/body-canvas-widget.cpp
+++ b/src/stage/timeline/body-canvas-widget.cpp
@@ -436,7 +436,7 @@ namespace timeline {
// respond to any structure changes of the timeline by recomputing the TrackProfile
layout_.signalStructureChange_.connect (sigc::mem_fun (*this, &BodyCanvasWidget::slotStructureChange));
- // access and possible (re)establish the current "profile" of the tracks on demand...
+ // on demand access and possible (re)establish the current "profile" of the tracks for drawing...
getProfile = [this]() -> TrackProfile&
{
maybeRebuildLayout();
@@ -704,6 +704,7 @@ namespace timeline {
cox->set_source_rgb(0.2, 0.4, 0.9); // blue
cox->set_line_width (2.0);
+ cox->move_to(w, 0);
cox->arc(rad, rad, rad, 0.0, 2.0*M_PI); // full circle
cox->stroke();
/////////////////////////////////////////////TICKET #1039 : placeholder drawing
diff --git a/src/stage/timeline/clip-presenter.hpp b/src/stage/timeline/clip-presenter.hpp
index f7a8849d6..625e2c0dd 100644
--- a/src/stage/timeline/clip-presenter.hpp
+++ b/src/stage/timeline/clip-presenter.hpp
@@ -223,6 +223,7 @@ namespace timeline {
private:/* ===== Subject-Interface ===== */
+ /** @internal Adapter used while a dragging gesture is in formation */
class DragRelocateObserver
: public interact::GestureObserver
{
@@ -240,8 +241,8 @@ namespace timeline {
% getCmdID()
% deltaX
% deltaY
- % subject_.widget_->accessStartTime()
% oldTime_
+ % subject_.widget_->accessStartTime()
<< std::endl;
}
@@ -285,10 +286,10 @@ namespace timeline {
* Whenever a new clip widget has been created, this function is also responsible
* for additional setup, and especially to enable the dragging gestures on this clip.
* @remark a typical example would be, when a clip's temporal position, previously unspecified,
- * now becomes defined through a diff message. With this data, it becomes feasible
+ * now becomes defined through a diff message. With this data, it then would become feasible
* _actually to show the clip_ in the timeline. Thus the [Appearance style](\ref ClipDelegate::Appearance)
* of the presentation widget (delegate) can be switched up from `PENDING` to `ABRIDGED`.
- * @note however this function is invoked from ctor and then serves to allocate the delegate initially.
+ * @note however this function is also invoked from ctor and then serves to allocate the delegate initially.
*/
void
establishAppearance(WidgetHook* newView =nullptr,
diff --git a/src/stage/timeline/timeline-layout.cpp b/src/stage/timeline/timeline-layout.cpp
index d6856190c..5908cd3bb 100644
--- a/src/stage/timeline/timeline-layout.cpp
+++ b/src/stage/timeline/timeline-layout.cpp
@@ -27,6 +27,9 @@
** @todo as of 10/2018 timeline display in the UI is rebuilt to match the architecture
** @todo WIP-WIP-WIP as of 12/2019
**
+ ** @see track-body.cpp for mapping individual tracks onto the common canvas
+ ** @see body-canvas-widget.cpp for painting track background and overlays
+ **
*/
diff --git a/src/stage/timeline/track-body.cpp b/src/stage/timeline/track-body.cpp
index aca615ca3..d7f81f72b 100644
--- a/src/stage/timeline/track-body.cpp
+++ b/src/stage/timeline/track-body.cpp
@@ -23,7 +23,9 @@
/** @file track-body.cpp
** Implementation details regarding display management of the
- ** track body area within the timeline display canvas.
+ ** track body area within the timeline display canvas. Especially,
+ ** this code handles the structuring of vertical space, and the way
+ ** this vertical extension maps to specific tracks.
**
** @todo WIP-WIP-WIP as of 6/2019
**
diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm
index 0af3bb00d..06cf0f353 100644
--- a/wiki/thinkPad.ichthyo.mm
+++ b/wiki/thinkPad.ichthyo.mm
@@ -5297,8 +5297,8 @@
-
-
+
+
@@ -5352,24 +5352,24 @@
-
-
+
+
-
-
+
+
-
+
-
+
@@ -5386,16 +5386,19 @@
-
-
+
+
-
-
+
+
+
+
+
@@ -5476,13 +5479,25 @@
-
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -17863,7 +17878,7 @@
-
+
@@ -20927,7 +20942,7 @@
-
+
@@ -23856,7 +23871,7 @@
-
+
@@ -23975,6 +23990,7 @@
+
@@ -25951,7 +25967,9 @@
-
+
+
+
@@ -28800,7 +28818,7 @@
-
+
@@ -29508,8 +29526,9 @@
-
-
+
+
+
@@ -30111,7 +30130,7 @@
-
+
@@ -30122,7 +30141,8 @@
-
+
+
@@ -31668,6 +31688,7 @@