migrated logo pane rendering

pull/95/head
jmoenig 2020-03-03 10:13:35 +01:00
rodzic 8e1f76a6b6
commit b3835f3c90
1 zmienionych plików z 8 dodań i 10 usunięć

Wyświetl plik

@ -580,10 +580,9 @@ IDE_Morph.prototype.createLogo = function () {
this.logo = new Morph(); this.logo = new Morph();
this.logo.texture = this.logoURL; this.logo.texture = this.logoURL;
this.logo.drawNew = function () {
this.image = newCanvas(this.extent(), false, this.image); this.logo.render = function (ctx) {
var context = this.image.getContext('2d'), gradient = ctx.createLinearGradient(
gradient = context.createLinearGradient(
0, 0,
0, 0,
this.width(), this.width(),
@ -591,17 +590,16 @@ IDE_Morph.prototype.createLogo = function () {
); );
gradient.addColorStop(0, 'black'); gradient.addColorStop(0, 'black');
gradient.addColorStop(0.5, myself.frameColor.toString()); gradient.addColorStop(0.5, myself.frameColor.toString());
context.fillStyle = MorphicPreferences.isFlat ? ctx.fillStyle = MorphicPreferences.isFlat ?
myself.frameColor.toString() : gradient; myself.frameColor.toString() : gradient;
context.fillRect(0, 0, this.width(), this.height()); ctx.fillRect(0, 0, this.width(), this.height());
if (this.texture) { if (this.texture) {
this.drawTexture(this.texture); this.renderTexture(this.texture, ctx);
} }
}; };
this.logo.drawCachedTexture = function () { this.logo.renderCachedTexture = function (ctx) {
var context = this.image.getContext('2d'); ctx.drawImage(
context.drawImage(
this.cachedTexture, this.cachedTexture,
5, 5,
Math.round((this.height() - this.cachedTexture.height) / 2) Math.round((this.height() - this.cachedTexture.height) / 2)