mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
Fix uses of const
This commit is contained in:
parent
9f9f210537
commit
3b68397a5e
1 changed files with 4 additions and 4 deletions
|
@ -443,10 +443,10 @@ var Raster = Item.extend(/** @lends Raster# */{
|
||||||
getSubCanvas: function(/* rect */) {
|
getSubCanvas: function(/* rect */) {
|
||||||
var rect = Rectangle.read(arguments),
|
var rect = Rectangle.read(arguments),
|
||||||
ctx = CanvasProvider.getContext(rect.getSize());
|
ctx = CanvasProvider.getContext(rect.getSize());
|
||||||
const clippedStartX = Math.max(0, rect.x);
|
var clippedStartX = Math.max(0, rect.x);
|
||||||
const clippedStartY = Math.max(0, rect.y);
|
var clippedStartY = Math.max(0, rect.y);
|
||||||
const clippedEndX = Math.min(this.getCanvas().width, rect.x + rect.width);
|
var clippedEndX = Math.min(this.getCanvas().width, rect.x + rect.width);
|
||||||
const clippedEndY = Math.min(this.getCanvas().height, rect.y + rect.height);
|
var clippedEndY = Math.min(this.getCanvas().height, rect.y + rect.height);
|
||||||
ctx.drawImage(this.getCanvas(),
|
ctx.drawImage(this.getCanvas(),
|
||||||
clippedStartX, clippedStartY,
|
clippedStartX, clippedStartY,
|
||||||
clippedEndX - clippedStartX, clippedEndY - clippedStartY,
|
clippedEndX - clippedStartX, clippedEndY - clippedStartY,
|
||||||
|
|
Loading…
Reference in a new issue