src/canvas.cpp

changeset 1177
8661b9237ed5
parent 1168
0b450b4559b8
child 1178
3a88e7a60b63
equal deleted inserted replaced
1176:07b574a4e31d 1177:8661b9237ed5
53 #endif 53 #endif
54 54
55 if (camera() != Camera::Free) 55 if (camera() != Camera::Free)
56 { 56 {
57 // Paint the coordinates onto the screen. 57 // Paint the coordinates onto the screen.
58 QString text = format(tr("X: %1, Y: %2, Z: %3"), m_position3D[X], m_position3D[Y], m_position3D[Z]); 58 Vertex idealized = currentCamera().idealize(m_position3D);
59 QString text = format(tr("X: %1, Y: %2, Z: %3, %4"), m_position3D[X], m_position3D[Y], m_position3D[Z],
60 idealized.toString(true));
59 QFontMetrics metrics {font()}; 61 QFontMetrics metrics {font()};
60 QRect textSize = metrics.boundingRect (0, 0, width(), height(), Qt::AlignCenter, text); 62 QRect textSize = metrics.boundingRect (0, 0, width(), height(), Qt::AlignCenter, text);
61 painter.setPen(textPen()); 63 painter.setPen(textPen());
62 painter.drawText(width() - textSize.width(), height() - 16, textSize.width(), textSize.height(), Qt::AlignCenter, text); 64 painter.drawText(width() - textSize.width(), height() - 16, textSize.width(), textSize.height(), Qt::AlignCenter, text);
63 } 65 }

mercurial