mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
parent
598d9a3356
commit
43ec699063
1 changed files with 7 additions and 2 deletions
|
@ -2173,6 +2173,11 @@ new function() { // Scope for drawing
|
||||||
// performance.
|
// performance.
|
||||||
|
|
||||||
function drawHandles(ctx, segments, matrix, size) {
|
function drawHandles(ctx, segments, matrix, size) {
|
||||||
|
// Only draw if size is not null or negative.
|
||||||
|
if (size <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var half = size / 2,
|
var half = size / 2,
|
||||||
coords = new Array(6),
|
coords = new Array(6),
|
||||||
pX, pY;
|
pX, pY;
|
||||||
|
@ -2204,8 +2209,8 @@ new function() { // Scope for drawing
|
||||||
// Draw a rectangle at segment.point:
|
// Draw a rectangle at segment.point:
|
||||||
ctx.fillRect(pX - half, pY - half, size, size);
|
ctx.fillRect(pX - half, pY - half, size, size);
|
||||||
// If the point is not selected, draw a white square that is 1 px
|
// If the point is not selected, draw a white square that is 1 px
|
||||||
// smaller on all sides:
|
// smaller on all sides. Only draw it if size is big enough (#1327).
|
||||||
if (!(selection & /*#=*/SegmentSelection.POINT)) {
|
if (!(selection & /*#=*/SegmentSelection.POINT) && size > 2) {
|
||||||
var fillStyle = ctx.fillStyle;
|
var fillStyle = ctx.fillStyle;
|
||||||
ctx.fillStyle = '#ffffff';
|
ctx.fillStyle = '#ffffff';
|
||||||
ctx.fillRect(pX - half + 1, pY - half + 1, size - 2, size - 2);
|
ctx.fillRect(pX - half + 1, pY - half + 1, size - 2, size - 2);
|
||||||
|
|
Loading…
Reference in a new issue