Don't draw edges and outlines while dragging an entity.
This is far too slow for realtime dragging, and results in assemblies falling apart (e.g. jansen-asm from the examples).
This commit is contained in:
parent
02b7e24812
commit
f2007326b4
|
@ -463,6 +463,15 @@ void GraphicsWindow::MouseMoved(double x, double y, bool leftDown,
|
||||||
pending.operation != DRAGGING_MARQUEE)
|
pending.operation != DRAGGING_MARQUEE)
|
||||||
{
|
{
|
||||||
SS.GenerateAll();
|
SS.GenerateAll();
|
||||||
|
|
||||||
|
// Activate degraded mode, and regenerate display items without edges.
|
||||||
|
if(activeGroup.v != 0) {
|
||||||
|
bool showEdges = SS.GW.showEdges;
|
||||||
|
SS.GW.showEdges = false;
|
||||||
|
SK.GetGroup(activeGroup)->GenerateDisplayItems();
|
||||||
|
SS.GW.showEdges = showEdges;
|
||||||
|
isDegraded = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -470,6 +479,12 @@ void GraphicsWindow::ClearPending(void) {
|
||||||
pending.points.Clear();
|
pending.points.Clear();
|
||||||
pending = {};
|
pending = {};
|
||||||
SS.ScheduleShowTW();
|
SS.ScheduleShowTW();
|
||||||
|
|
||||||
|
// If degraded mode was enabled, we need to regenerate again to get edges back.
|
||||||
|
if(isDegraded) {
|
||||||
|
isDegraded = false;
|
||||||
|
SK.GetGroup(activeGroup)->displayDirty = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GraphicsWindow::MouseMiddleOrRightDown(double x, double y) {
|
void GraphicsWindow::MouseMiddleOrRightDown(double x, double y) {
|
||||||
|
|
3
src/ui.h
3
src/ui.h
|
@ -504,6 +504,9 @@ public:
|
||||||
// allowing a paint in between. The extra solves are wasted if they're
|
// allowing a paint in between. The extra solves are wasted if they're
|
||||||
// not displayed.
|
// not displayed.
|
||||||
bool havePainted;
|
bool havePainted;
|
||||||
|
// Similarly, don't draw edges and outlines, since that's too slow
|
||||||
|
// for real-time dragging.
|
||||||
|
bool isDegraded;
|
||||||
|
|
||||||
// Some state for the context menu.
|
// Some state for the context menu.
|
||||||
struct {
|
struct {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user