src/glcamera.cpp

changeset 1180
2005e4147ad6
parent 1179
1a9ffd5e0399
child 1199
613a981223a6
child 1237
40bb00d82e2b
child 1254
73097a86e8dc
equal deleted inserted replaced
1179:1a9ffd5e0399 1180:2005e4147ad6
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

mercurial