comparison Framework/Scene2DViewport/MeasureToolsToolbox.cpp @ 774:66ac7a2d1e3a

A few renames and cleanups + moved GUI constants to controller + start work on hit tests for measure tools and mouse hover.
author Benjamin Golinvaux <bgo@osimis.io>
date Fri, 24 May 2019 15:59:51 +0200
parents 92c400a09f1b
children e42b491f1fb2
comparison
equal deleted inserted replaced
761:07adcffba38c 774:66ac7a2d1e3a
19 **/ 19 **/
20 20
21 #include "MeasureToolsToolbox.h" 21 #include "MeasureToolsToolbox.h"
22 #include "PointerTypes.h" 22 #include "PointerTypes.h"
23 #include "LayerHolder.h" 23 #include "LayerHolder.h"
24 #include "ViewportController.h"
24 25
25 #include "../Scene2D/TextSceneLayer.h" 26 #include "../Scene2D/TextSceneLayer.h"
26 #include "../Scene2D/Scene2D.h" 27 #include "../Scene2D/Scene2D.h"
27 28
28 #include <boost/math/constants/constants.hpp> 29 #include <boost/math/constants/constants.hpp>
279 chain.push_back(startRB); 280 chain.push_back(startRB);
280 chain.push_back(startLB); 281 chain.push_back(startLB);
281 } 282 }
282 #endif 283 #endif
283 284
284
285 /** 285 /**
286 This utility function assumes that the layer holder contains 5 text layers 286 This utility function assumes that the layer holder contains 5 text layers
287 and will use the first four ones for the text background and the fifth one 287 and will use the first four ones for the text background and the fifth one
288 for the actual text 288 for the actual text
289 */ 289 */
302 { 302 {
303 TextSceneLayer* textLayer = layerHolder->GetTextLayer(i); 303 TextSceneLayer* textLayer = layerHolder->GetTextLayer(i);
304 textLayer->SetText(text); 304 textLayer->SetText(text);
305 305
306 if (i == 4) 306 if (i == 4)
307 textLayer->SetColor(0, 223, 81); 307 {
308 textLayer->SetColor(TEXT_COLOR_RED,
309 TEXT_COLOR_GREEN,
310 TEXT_COLOR_BLUE);
311 }
308 else 312 else
309 textLayer->SetColor(0, 56, 21); 313 {
314 textLayer->SetColor(TEXT_OUTLINE_COLOR_RED,
315 TEXT_OUTLINE_COLOR_GREEN,
316 TEXT_OUTLINE_COLOR_BLUE);
317 }
310 318
311 ScenePoint2D textAnchor; 319 ScenePoint2D textAnchor;
312 //GetPositionOnBisectingLine(
313 // textAnchor, side1End_, center_, side2End_, 40.0*pixelToScene);
314 textLayer->SetPosition( 320 textLayer->SetPosition(
315 p.GetX() + xoffsets[i] * pixelToScene, 321 p.GetX() + xoffsets[i] * pixelToScene,
316 p.GetY() + yoffsets[i] * pixelToScene); 322 p.GetY() + yoffsets[i] * pixelToScene);
317 } 323 }
318 } 324 }
319
320
321
322
323
324
325
326
327 } 325 }