comparison Framework/Scene2DViewport/LineMeasureTool.cpp @ 804:61ba4b504e9a

PolylineSceneLayer now has one color per chain
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 28 May 2019 15:58:21 +0200
parents 66ac7a2d1e3a
children e42b491f1fb2
comparison
equal deleted inserted replaced
802:f38c1fc08655 804:61ba4b504e9a
105 { 105 {
106 // Fill the polyline layer with the measurement line 106 // Fill the polyline layer with the measurement line
107 107
108 PolylineSceneLayer* polylineLayer = layerHolder_->GetPolylineLayer(0); 108 PolylineSceneLayer* polylineLayer = layerHolder_->GetPolylineLayer(0);
109 polylineLayer->ClearAllChains(); 109 polylineLayer->ClearAllChains();
110 polylineLayer->SetColor( 110
111 TOOL_LINES_COLOR_RED, 111 const Color color(TOOL_LINES_COLOR_RED,
112 TOOL_LINES_COLOR_GREEN, 112 TOOL_LINES_COLOR_GREEN,
113 TOOL_LINES_COLOR_BLUE); 113 TOOL_LINES_COLOR_BLUE);
114 114
115 { 115 {
116 PolylineSceneLayer::Chain chain; 116 PolylineSceneLayer::Chain chain;
117 chain.push_back(start_); 117 chain.push_back(start_);
118 chain.push_back(end_); 118 chain.push_back(end_);
119 polylineLayer->AddChain(chain, false); 119 polylineLayer->AddChain(chain, false, color);
120 } 120 }
121 121
122 // handles 122 // handles
123 { 123 {
124 { 124 {
126 126
127 //TODO: take DPI into account 127 //TODO: take DPI into account
128 AddSquare(chain, GetScene(), start_, 128 AddSquare(chain, GetScene(), start_,
129 GetController()->GetHandleSideLengthS()); 129 GetController()->GetHandleSideLengthS());
130 130
131 polylineLayer->AddChain(chain, true); 131 polylineLayer->AddChain(chain, true, color);
132 } 132 }
133 133
134 { 134 {
135 PolylineSceneLayer::Chain chain; 135 PolylineSceneLayer::Chain chain;
136 136
137 //TODO: take DPI into account 137 //TODO: take DPI into account
138 AddSquare(chain, GetScene(), end_, 138 AddSquare(chain, GetScene(), end_,
139 GetController()->GetHandleSideLengthS()); 139 GetController()->GetHandleSideLengthS());
140 140
141 polylineLayer->AddChain(chain, true); 141 polylineLayer->AddChain(chain, true, color);
142 } 142 }
143 } 143 }
144 144
145 } 145 }
146 { 146 {