feat: Refine snap origin indicator to outlined and zoom-independent
Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
@@ -138,11 +138,9 @@ void ViewportWidget::paintGL()
|
||||
}
|
||||
|
||||
if (m_isSnappingOrigin) {
|
||||
const float rectSize = 0.2f;
|
||||
glColor4f(1.0, 1.0, 0.0, 0.5f);
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glBegin(GL_QUADS);
|
||||
const float rectSize = 0.0075f * -m_zoom;
|
||||
glColor3f(1.0, 1.0, 0.0);
|
||||
glBegin(GL_LINE_LOOP);
|
||||
if (m_currentPlane == SketchPlane::XY) {
|
||||
glVertex3f(-rectSize, -rectSize, 0);
|
||||
glVertex3f( rectSize, -rectSize, 0);
|
||||
@@ -160,7 +158,6 @@ void ViewportWidget::paintGL()
|
||||
glVertex3f(0, -rectSize, rectSize);
|
||||
}
|
||||
glEnd();
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
||||
if (m_isDefiningLine && m_activeTool == static_cast<int>(ApplicationController::ToolType::Line)) {
|
||||
@@ -234,7 +231,7 @@ void ViewportWidget::mouseMoveEvent(QMouseEvent *event)
|
||||
bool shouldSnap = false;
|
||||
if (m_currentPlane != SketchPlane::NONE) {
|
||||
QVector3D worldPos = unproject(m_currentMousePos);
|
||||
const float snapThreshold = 0.5f;
|
||||
const float snapThreshold = 0.025f * -m_zoom;
|
||||
shouldSnap = worldPos.length() < snapThreshold;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user