105 double cy = m_virtualSize.height() - (2 * position2d.y() * m_virtualSize.height() / m_size.height()) - m_panningY; |
105 double cy = m_virtualSize.height() - (2 * position2d.y() * m_virtualSize.height() / m_size.height()) - m_panningY; |
106 |
106 |
107 // If a grid was passed, snap coordinates to it. |
107 // If a grid was passed, snap coordinates to it. |
108 if (grid) |
108 if (grid) |
109 { |
109 { |
110 cx = grid->snap(cx); |
110 QPointF snapped = grid->snap({cx, cy}); |
111 cy = grid->snap(cy); |
111 cx = snapped.x(); |
|
112 cy = snapped.y(); |
112 } |
113 } |
113 |
114 |
114 roundToDecimals(cx, 4); |
115 roundToDecimals(cx, 4); |
115 roundToDecimals(cy, 4); |
116 roundToDecimals(cy, 4); |
116 |
117 |