recycle cached Canvasses in graphic symbols

pull/89/head
jmoenig 2020-01-03 14:16:09 +01:00
rodzic 5d979feff7
commit 8e27643869
3 zmienionych plików z 12 dodań i 7 usunięć

Wyświetl plik

@ -14,6 +14,7 @@
* blocks: recycle cached Canvasses
* widgets: recycle cached Canvasses
* byob: recycle cached Canvasses
* symbols: recycle cached Canvasses
## 5.4.0:
* **New Features:**

Wyświetl plik

@ -14,7 +14,7 @@
<script type="text/javascript" src="src/lists.js?version=2019-12-08"></script>
<script type="text/javascript" src="src/byob.js?version=2020-01-03"></script>
<script type="text/javascript" src="src/tables.js?version=2019-06-27"></script>
<script type="text/javascript" src="src/symbols.js?version=2019-06-27"></script>
<script type="text/javascript" src="src/symbols.js?version=2020-01-03"></script>
<script type="text/javascript" src="src/sketch.js?version=2019-10-09"></script>
<script type="text/javascript" src="src/video.js?version=2019-06-27"></script>
<script type="text/javascript" src="src/maps.js?version=2019-10-28"></script>

Wyświetl plik

@ -7,7 +7,7 @@
written by Jens Mönig
jens@moenig.org
Copyright (C) 2019 by Jens Mönig
Copyright (C) 2020 by Jens Mönig
This file is part of Snap!.
@ -41,7 +41,7 @@
// Global stuff ////////////////////////////////////////////////////////
modules.symbols = '2019-February-07';
modules.symbols = '2020-January-03';
var SymbolMorph;
@ -186,10 +186,14 @@ SymbolMorph.prototype.setLabelColor = function (
SymbolMorph.prototype.drawNew = function () {
var ctx, x, y, sx, sy;
this.image = newCanvas(new Point(
this.symbolWidth() + Math.abs(this.shadowOffset.x),
this.size + Math.abs(this.shadowOffset.y)
));
this.image = newCanvas(
new Point(
this.symbolWidth() + Math.abs(this.shadowOffset.x),
this.size + Math.abs(this.shadowOffset.y)
),
false,
this.image
);
this.silentSetWidth(this.image.width);
this.silentSetHeight(this.image.height);
ctx = this.image.getContext('2d');