src/canvas.cpp

changeset 1106
7541b0209057
parent 1105
4f4d219e527d
child 1108
90d6f4b7782e
equal deleted inserted replaced
1105:4f4d219e527d 1106:7541b0209057
173 173
174 const Vertex& Canvas::position3D() const 174 const Vertex& Canvas::position3D() const
175 { 175 {
176 return m_position3D; 176 return m_position3D;
177 } 177 }
178
179 void Canvas::drawPoint(QPainter& painter, QPointF pos, QColor color) const
180 {
181 int pointSize = 8;
182 QPen pen = thinBorderPen;
183 pen.setWidth(1);
184 painter.setPen(pen);
185 painter.setBrush(color);
186 painter.drawEllipse(pos.x() - pointSize / 2, pos.y() - pointSize / 2, pointSize, pointSize);
187 }
188
189 void Canvas::drawBlipCoordinates(QPainter& painter, const Vertex& pos3d) const
190 {
191 drawBlipCoordinates (painter, pos3d, convert3dTo2d (pos3d));
192 }
193
194 void Canvas::drawBlipCoordinates(QPainter& painter, const Vertex& pos3d, QPointF pos) const
195 {
196 painter.setPen (textPen());
197 painter.drawText (pos.x(), pos.y() - 8, pos3d.toString (true));
198 }
199
200 QPen Canvas::linePen() const
201 {
202 QPen linepen = thinBorderPen;
203 linepen.setWidth(2);
204 linepen.setColor(luma(backgroundColor()) < 40 ? Qt::white : Qt::black);
205 return linepen;
206 }

mercurial