Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit 450c1b1

Browse files
committed
Merge branch 'master' of github.com:literallycanvas/literallycanvas
2 parents f9fa062 + 5ce8c7f commit 450c1b1

File tree

7 files changed

+17
-4
lines changed

7 files changed

+17
-4
lines changed

src/core/actions.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class AddShapeAction
6666
newShapes = []
6767
for shape in @lc.shapes
6868
newShapes.push(shape) if shape.id != @shape.id
69-
lc.shapes = newShapes
69+
@lc.shapes = newShapes
7070
@lc.repaintLayer('main')
7171

7272

src/core/canvasRenderer.coffee

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ defineCanvasRenderer 'SelectionBox', do ->
9090
shape._br.width + shape.margin * 2,
9191
shape._br.height + shape.margin * 2)
9292
ctx.lineWidth = 1
93-
ctx.strokeStyle = '#000'
93+
ctx.strokeStyle = shape.backgroundColor or '#000'
9494
ctx.setLineDash([2, 4])
9595
ctx.strokeRect(
9696
shape._br.x - shape.margin, shape._br.y - shape.margin,

src/reactGUI/UndoRedoButtons.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ DOM = require '../reactGUI/ReactDOMFactories-shim'
33
createReactClass = require '../reactGUI/createReactClass-shim'
44
createSetStateOnEventMixin = require './createSetStateOnEventMixin'
55
{classSet} = require '../core/util'
6+
{_} = require '../core/localization'
67

78
createUndoRedoButtonComponent = (undoOrRedo) -> createReactClass
89
displayName: if undoOrRedo == 'undo' then 'UndoButton' else 'RedoButton'
@@ -26,7 +27,7 @@ createUndoRedoButtonComponent = (undoOrRedo) -> createReactClass
2627
{div, img} = DOM
2728
{lc, imageURLPrefix} = @props
2829
title = if undoOrRedo == 'undo' then 'Undo' else 'Redo'
29-
30+
title = _(title)
3031
className = "lc-#{undoOrRedo} " + classSet
3132
'toolbar-button': true
3233
'thin-button': true

src/reactGUI/ZoomButtons.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ DOM = require '../reactGUI/ReactDOMFactories-shim'
33
createReactClass = require '../reactGUI/createReactClass-shim'
44
createSetStateOnEventMixin = require './createSetStateOnEventMixin'
55
{classSet} = require '../core/util'
6+
{_} = require '../core/localization'
67

78
createZoomButtonComponent = (inOrOut) -> createReactClass
89
displayName: if inOrOut == 'in' then 'ZoomInButton' else 'ZoomOutButton'
@@ -19,7 +20,7 @@ createZoomButtonComponent = (inOrOut) -> createReactClass
1920
{div, img} = DOM
2021
{lc, imageURLPrefix} = @props
2122
title = if inOrOut == 'in' then 'Zoom in' else 'Zoom out'
22-
23+
title = _(title)
2324
className = "lc-zoom-#{inOrOut} " + classSet
2425
'toolbar-button': true
2526
'thin-button': true

src/tools/Ellipse.coffee

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,7 @@ module.exports = class Ellipse extends ToolWithStroke
2020
lc.drawShapeInProgress(@currentShape)
2121

2222
end: (x, y, lc) ->
23+
# If there is no height or width, dont save
24+
if @currentShape.height == 0 or @currentShape.width == 0
25+
return
2326
lc.saveShape(@currentShape)

src/tools/Line.coffee

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,9 @@ module.exports = class Line extends ToolWithStroke
2424
lc.drawShapeInProgress(@currentShape)
2525

2626
end: (x, y, lc) ->
27+
# If start == end, dont save
28+
sameX = @currentShape.x1 == @currentShape.x2
29+
sameY = @currentShape.y1 == @currentShape.y2
30+
if sameX and sameY
31+
return
2732
lc.saveShape(@currentShape)

src/tools/Rectangle.coffee

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,7 @@ module.exports = class Rectangle extends ToolWithStroke
1919
lc.drawShapeInProgress(@currentShape)
2020

2121
end: (x, y, lc) ->
22+
# If there is no height or width, dont save
23+
if @currentShape.height == 0 or @currentShape.width == 0
24+
return
2225
lc.saveShape(@currentShape)

0 commit comments

Comments
 (0)