diff Framework/Radiography/RadiographyLayerCropTracker.cpp @ 476:a95090305dd4 am-touch-events

Introduced ControlPoint instead of Corner in the trackers and layers + drawing mask from the ControlPoints
author am@osimis.io
date Wed, 13 Feb 2019 12:04:02 +0100
parents 3b4df9925db6
children 4f2416d519b4
line wrap: on
line diff
--- a/Framework/Radiography/RadiographyLayerCropTracker.cpp	Tue Feb 12 12:22:13 2019 +0100
+++ b/Framework/Radiography/RadiographyLayerCropTracker.cpp	Wed Feb 13 12:04:02 2019 +0100
@@ -68,12 +68,10 @@
                                                            RadiographyScene& scene,
                                                            const ViewportGeometry& view,
                                                            size_t layer,
-                                                           double x,
-                                                           double y,
-                                                           Corner corner) :
+                                                           const ControlPoint& startControlPoint) :
     undoRedoStack_(undoRedoStack),
     accessor_(scene, layer),
-    corner_(corner)
+    startControlPoint_(startControlPoint)
   {
     if (accessor_.IsValid())
     {
@@ -114,8 +112,8 @@
       {
         unsigned int targetX, targetWidth;
 
-        if (corner_ == Corner_TopLeft ||
-            corner_ == Corner_BottomLeft)
+        if (startControlPoint_.index == ControlPoint_TopLeftCorner ||
+            startControlPoint_.index == ControlPoint_BottomLeftCorner)
         {
           targetX = std::min(x, cropX_ + cropWidth_);
           targetWidth = cropX_ + cropWidth_ - targetX;
@@ -128,8 +126,8 @@
 
         unsigned int targetY, targetHeight;
 
-        if (corner_ == Corner_TopLeft ||
-            corner_ == Corner_TopRight)
+        if (startControlPoint_.index == ControlPoint_TopLeftCorner ||
+            startControlPoint_.index == ControlPoint_TopRightCorner)
         {
           targetY = std::min(y, cropY_ + cropHeight_);
           targetHeight = cropY_ + cropHeight_ - targetY;