From 669e6f0dcbc2c19e63536696d932e4233dcfe6e4 Mon Sep 17 00:00:00 2001 From: EvilSpirit Date: Fri, 20 Jan 2017 09:56:35 +0700 Subject: [PATCH] Select the appropriate entity when dragging a circle or a normal. This commit adds logic that was missed in 25631d4. --- src/mouse.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mouse.cpp b/src/mouse.cpp index 41edcea..9948d50 100644 --- a/src/mouse.cpp +++ b/src/mouse.cpp @@ -178,17 +178,18 @@ void GraphicsWindow::MouseMoved(double x, double y, bool leftDown, // start dragging something. if(leftDown && dm > 3) { Entity *e = NULL; - if(hover.entity.v) e = SK.GetEntity(hover.entity); + hEntity dragEntity = ChooseFromHoverToDrag().entity; + if(dragEntity.v) e = SK.GetEntity(dragEntity); if(e && e->type != Entity::Type::WORKPLANE) { - Entity *e = SK.GetEntity(hover.entity); + Entity *e = SK.GetEntity(dragEntity); if(e->type == Entity::Type::CIRCLE && selection.n <= 1) { // Drag the radius. ClearSelection(); - pending.circle = hover.entity; + pending.circle = dragEntity; pending.operation = Pending::DRAGGING_RADIUS; } else if(e->IsNormal()) { ClearSelection(); - pending.normal = hover.entity; + pending.normal = dragEntity; pending.operation = Pending::DRAGGING_NORMAL; } else { if(!hoverWasSelectedOnMousedown) {