comparison Samples/Common/MeasureToolsToolbox.cpp @ 654:462a5074f914

Turned the scene into an observable to be able to dynamically react to scene to canvas transform changes --> now the handles and angle measure adornments are immune to zoom changes
author Benjamin Golinvaux <bgo@osimis.io>
date Tue, 14 May 2019 13:51:00 +0200
parents 62f6ff016085
children
comparison
equal deleted inserted replaced
653:4eccf698e52f 654:462a5074f914
41 const double& sideLength) 41 const double& sideLength)
42 { 42 {
43 chain.clear(); 43 chain.clear();
44 chain.reserve(4); 44 chain.reserve(4);
45 ScenePoint2D centerC = centerS.Apply(scene.GetSceneToCanvasTransform()); 45 ScenePoint2D centerC = centerS.Apply(scene.GetSceneToCanvasTransform());
46 //TODO: take DPI into account 46 //TODO: take DPI into account
47 double handleLX = centerC.GetX() - sideLength / 2; 47 double handleLX = centerC.GetX() - sideLength / 2;
48 double handleTY = centerC.GetY() - sideLength / 2; 48 double handleTY = centerC.GetY() - sideLength / 2;
49 double handleRX = centerC.GetX() + sideLength / 2; 49 double handleRX = centerC.GetX() + sideLength / 2;
50 double handleBY = centerC.GetY() + sideLength / 2; 50 double handleBY = centerC.GetY() + sideLength / 2;
51 ScenePoint2D LTC(handleLX, handleTY); 51 ScenePoint2D LTC(handleLX, handleTY);