From 7d1297fcf44c26f6573361c989f0546df792d89b Mon Sep 17 00:00:00 2001 From: Jonathan Puckey Date: Fri, 3 Jun 2011 11:33:34 +0200 Subject: [PATCH] Path#draw: Fix drawing of selected path handles. --- src/path/Path.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/path/Path.js b/src/path/Path.js index 16c40da6..16de266c 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -681,15 +681,17 @@ var Path = this.Path = PathItem.extend({ pointSelected = segment._selectionState == SelectionState.POINT; // TODO: draw handles depending on selection state of // segment.point and neighbouring segments. - if (pointSelected || segment.isSelected(segment._handleIn)) + if (pointSelected || segment._isSelected(segment._handleIn)) drawHandle(ctx, point, segment._handleIn); - if (pointSelected || segment.isSelected(segment._handleOut)) + if (pointSelected || segment._isSelected(segment._handleOut)) drawHandle(ctx, point, segment._handleOut); // Draw a rectangle at segment.point: ctx.save(); ctx.beginPath(); ctx.rect(point._x - 2, point._y - 2, 4, 4); ctx.fill(); + // If the point is not selected, draw a white square that is 1 px + // smaller on all sides: if (!pointSelected) { ctx.beginPath(); ctx.rect(point._x - 1, point._y - 1, 2, 2);