wgge 1.0.4 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -47,9 +47,8 @@ export default class CanvasRenderer extends RendererBase {
47
47
  */
48
48
  drawRect(start, size, fill = 'black') {
49
49
  if (!this.checkContext()) return;
50
- const end = start.add(size);
51
50
  this.context2d.fillStyle = fill;
52
- this.context2d.fillRect(start.x, start.y, end.x, end.y);
51
+ this.context2d.fillRect(start.x, start.y, size.x, size.y);
53
52
  }
54
53
 
55
54
  /**
@@ -108,25 +107,25 @@ export default class CanvasRenderer extends RendererBase {
108
107
  this.drawArc(center, radius, fill, stroke);
109
108
  }
110
109
 
111
- drawImage(image, drawStart, drawEnd, imageStart, imageEnd, opacity = 1, clear = true) {
110
+ drawImage(image, drawStart, drawSize, imageStart, imageSize, opacity = 1, clear = true) {
112
111
  if (!image) {
113
112
  console.error('No image to draw!');
114
113
  return;
115
114
  }
116
115
  if (!this.checkContext()) return;
117
116
 
118
- if (clear) this.context2d.clearRect(drawStart.x, drawStart.y, drawEnd.x, drawEnd.y);
117
+ if (clear) this.context2d.clearRect(drawStart.x, drawStart.y, drawSize.x, drawSize.y);
119
118
  this.context2d.globalAlpha = opacity;
120
119
  this.context2d.drawImage(
121
120
  image,
122
121
  imageStart.x,
123
122
  imageStart.y,
124
- imageEnd.x,
125
- imageEnd.y,
123
+ imageSize.x,
124
+ imageSize.y,
126
125
  drawStart.x,
127
126
  drawStart.y,
128
- drawEnd.x,
129
- drawEnd.y
127
+ drawSize.x,
128
+ drawSize.y
130
129
  );
131
130
  }
132
131
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wgge",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Web GL Game Engine",
5
5
  "main": "index.js",
6
6
  "devDependencies": {