BlueGit

timfa frameworkv3

fix this.size.x / y instead of width/height (since this is the vector definition)

timfa wsadhelios · pushed by timfa

Authored 2022-10-15 · 4 years ago

Hash
b4a9b1ebf1c2055462443f9c582553b256a87c75
Parent
91e57d2f
1 file changed +5 −5
framework/engine/scene.js +5 −5
@@ -103,17 +103,17 @@ class Scene
103 103
104 104 if(this.fullscreen)
105 105 {
106 this.size.width = window.innerWidth;
107 this.size.height = window.innerHeight;
106 this.size.x = window.innerWidth;
107 this.size.y = window.innerHeight;
108 108 }
109 109
110 this.canvas.width = this.size.width;
111 this.canvas.height = this.size.height;
110 this.canvas.width = this.size.x;
111 this.canvas.height = this.size.y;
112 112
113 113 this.canvas.style = 'position: absolute; left: ' + this.position.x + 'px; top: ' + this.position.y + 'px;'; //todo: only call when changed?
114 114
115 115 this.context.fillStyle = "rgb(" + this.backgroundColor.r + "," + this.backgroundColor.g + "," + this.backgroundColor.b + ")"; // sets the color to fill in the rectangle with
116 this.context.fillRect(0, 0, this.size.width, this.size.height);
116 this.context.fillRect(0, 0, this.size.x, this.size.y);
117 117
118 118 for(var i = 0; i < this.activeObjects.length; i++)
119 119 {
@@ -103,17 +103,17 @@ class Scene
103
103
104 if(this.fullscreen)
104 if(this.fullscreen)
105 {
105 {
106 this.size.width = window.innerWidth;
106 this.size.x = window.innerWidth;
107 this.size.height = window.innerHeight;
107 this.size.y = window.innerHeight;
108 }
108 }
109
109
110 this.canvas.width = this.size.width;
110 this.canvas.width = this.size.x;
111 this.canvas.height = this.size.height;
111 this.canvas.height = this.size.y;
112
112
113 this.canvas.style = 'position: absolute; left: ' + this.position.x + 'px; top: ' + this.position.y + 'px;'; //todo: only call when changed?
113 this.canvas.style = 'position: absolute; left: ' + this.position.x + 'px; top: ' + this.position.y + 'px;'; //todo: only call when changed?
114
114
115 this.context.fillStyle = "rgb(" + this.backgroundColor.r + "," + this.backgroundColor.g + "," + this.backgroundColor.b + ")"; // sets the color to fill in the rectangle with
115 this.context.fillStyle = "rgb(" + this.backgroundColor.r + "," + this.backgroundColor.g + "," + this.backgroundColor.b + ")"; // sets the color to fill in the rectangle with
116 this.context.fillRect(0, 0, this.size.width, this.size.height);
116 this.context.fillRect(0, 0, this.size.x, this.size.y);
117
117
118 for(var i = 0; i < this.activeObjects.length; i++)
118 for(var i = 0; i < this.activeObjects.length; i++)
119 {
119 {