src/editmodes/abstractEditMode.cpp

changeset 1098
0b837bed121d
parent 1088
c6d242d2b619
child 1099
14276e435640
equal deleted inserted replaced
1097:9a9e6ce0c5dc 1098:0b837bed121d
25 #include "circleMode.h" 25 #include "circleMode.h"
26 #include "magicWandMode.h" 26 #include "magicWandMode.h"
27 #include "linePathMode.h" 27 #include "linePathMode.h"
28 #include "curvemode.h" 28 #include "curvemode.h"
29 #include "../mainwindow.h" 29 #include "../mainwindow.h"
30 #include "../ldDocument.h"
30 #include "../glRenderer.h" 31 #include "../glRenderer.h"
31 #include "../miscallenous.h" 32 #include "../miscallenous.h"
32 #include "../grid.h" 33 #include "../grid.h"
33 34
34 ConfigOption (bool DrawLineLengths = true) 35 ConfigOption (bool DrawLineLengths = true)
119 double minimumDistance = 1024.0; 120 double minimumDistance = 1024.0;
120 const Vertex* closest = nullptr; 121 const Vertex* closest = nullptr;
121 Vertex cursorPosition = renderer()->convert2dTo3d(data.ev->pos(), false); 122 Vertex cursorPosition = renderer()->convert2dTo3d(data.ev->pos(), false);
122 QPoint cursorPosition2D = data.ev->pos(); 123 QPoint cursorPosition2D = data.ev->pos();
123 const Axis depthAxis = renderer()->getRelativeZ(); 124 const Axis depthAxis = renderer()->getRelativeZ();
124 QList<Vertex> vertices = renderer()->document()->inlineVertices().toList(); 125 QList<Vertex> vertices = currentDocument()->inlineVertices().toList();
125 126
126 // Sort the vertices in order of distance to camera 127 // Sort the vertices in order of distance to camera
127 std::sort(vertices.begin(), vertices.end(), [&](const Vertex& a, const Vertex& b) -> bool 128 std::sort(vertices.begin(), vertices.end(), [&](const Vertex& a, const Vertex& b) -> bool
128 { 129 {
129 if (renderer()->cameraInfo(renderer()->camera()).negatedDepth) 130 if (renderer()->cameraInfo(renderer()->camera()).negatedDepth)
194 { 195 {
195 int position = m_window->suggestInsertPoint(); 196 int position = m_window->suggestInsertPoint();
196 197
197 if (countof(model) > 0) 198 if (countof(model) > 0)
198 { 199 {
199 renderer()->document()->merge(model, position); 200 renderer()->model()->merge(model, position);
200 m_window->refresh(); 201 m_window->refresh();
201 m_window->endAction(); 202 m_window->endAction();
202 } 203 }
203 204
204 m_drawedVerts.clear(); 205 m_drawedVerts.clear();

mercurial