recycle cached Canvasses in table views

pull/89/head
jmoenig 2020-01-03 14:22:02 +01:00
rodzic 8e27643869
commit b72c4bce5f
3 zmienionych plików z 11 dodań i 9 usunięć

Wyświetl plik

@ -3,6 +3,7 @@
## in development: ## in development:
* **New Features:** * **New Features:**
* **Notable Changes:** * **Notable Changes:**
* optimized loading projects
* **Notable Fixes:** * **Notable Fixes:**
* **Translation Updates:** * **Translation Updates:**
@ -15,6 +16,7 @@
* widgets: recycle cached Canvasses * widgets: recycle cached Canvasses
* byob: recycle cached Canvasses * byob: recycle cached Canvasses
* symbols: recycle cached Canvasses * symbols: recycle cached Canvasses
* symbols: recycle cached Canvasses
## 5.4.0: ## 5.4.0:
* **New Features:** * **New Features:**

Wyświetl plik

@ -13,7 +13,7 @@
<script type="text/javascript" src="src/paint.js?version=2019-06-27"></script> <script type="text/javascript" src="src/paint.js?version=2019-06-27"></script>
<script type="text/javascript" src="src/lists.js?version=2019-12-08"></script> <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/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/tables.js?version=2020-01-03"></script>
<script type="text/javascript" src="src/symbols.js?version=2020-01-03"></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/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/video.js?version=2019-06-27"></script>

Wyświetl plik

@ -7,7 +7,7 @@
written by Jens Mönig written by Jens Mönig
jens@moenig.org jens@moenig.org
Copyright (C) 2016 by Jens Mönig Copyright (C) 2020 by Jens Mönig
This file is part of Snap!. This file is part of Snap!.
@ -64,13 +64,13 @@
// Global settings ///////////////////////////////////////////////////// // Global settings /////////////////////////////////////////////////////
/*global modules, Point, newCanvas, Morph, fontHeight, SliderMorph, List, /*global modules, Point, newCanvas, Morph, fontHeight, SliderMorph, isString,
MorphicPreferences, FrameMorph, HandleMorph, DialogBoxMorph, isString, MorphicPreferences, FrameMorph, HandleMorph, DialogBoxMorph, StringMorph,
SpriteMorph, Context, Costume, ArgMorph, BlockEditorMorph, SymbolMorph, SpriteMorph, Context, Costume, ArgMorph, BlockEditorMorph, SymbolMorph, List,
SyntaxElementMorph, MenuMorph, SpriteBubbleMorph, SpeechBubbleMorph, Sound, SyntaxElementMorph, MenuMorph, SpriteBubbleMorph, SpeechBubbleMorph, Sound,
CellMorph, ListWatcherMorph, isNil, BoxMorph, Variable, isSnapObject*/ CellMorph, ListWatcherMorph, isNil, BoxMorph, Variable, isSnapObject*/
modules.tables = '2019-June-04'; modules.tables = '2020-January-03';
var Table; var Table;
var TableCellMorph; var TableCellMorph;
@ -312,7 +312,7 @@ TableCellMorph.prototype.getData = function () {
}; };
TableCellMorph.prototype.drawNew = function () { TableCellMorph.prototype.drawNew = function () {
this.image = newCanvas(this.extent()); this.image = newCanvas(this.extent(), false, this.image);
this.drawData(); this.drawData();
}; };
@ -634,7 +634,7 @@ TableMorph.prototype.updateScrollBars = function () {
TableMorph.prototype.drawNew = function () { TableMorph.prototype.drawNew = function () {
var context, w, i; var context, w, i;
this.image = newCanvas(this.extent()); this.image = newCanvas(this.extent(), false, this.image);
context = this.image.getContext('2d'); context = this.image.getContext('2d');
context.fillStyle = 'rgb(220, 220, 220)'; context.fillStyle = 'rgb(220, 220, 220)';
BoxMorph.prototype.outlinePath.call( BoxMorph.prototype.outlinePath.call(
@ -824,7 +824,7 @@ TableMorph.prototype.update = function () {
// TableMorph layout helpers (all private): // TableMorph layout helpers (all private):
TableMorph.prototype.rowLabelsWidth = function () { TableMorph.prototype.rowLabelsWidth = function () {
var ctx = newCanvas().getContext('2d'); var ctx = StringMorph.prototype.measureCtx;
ctx.font = 'italic ' + SyntaxElementMorph.prototype.fontSize + ctx.font = 'italic ' + SyntaxElementMorph.prototype.fontSize +
'px Helvetica, Arial, sans-serif'; 'px Helvetica, Arial, sans-serif';
return Math.max( return Math.max(