Select the appropriate entity when dragging a circle or a normal.

This commit adds logic that was missed in 25631d4.
pull/168/head
EvilSpirit 2017-01-20 09:56:35 +07:00 committed by whitequark
parent 119b17ac75
commit 669e6f0dcb
1 changed files with 5 additions and 4 deletions

View File

@ -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) {