pixi-watchface-engine 0.1.2 → 0.1.3

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.
package/dist/index.js CHANGED
@@ -34829,12 +34829,19 @@ class GridPlugin {
34829
34829
  drawGrid() {
34830
34830
  this.gridGraphics.clear();
34831
34831
  const { width, height } = this.engine.options;
34832
+ const { x: ox, y: oy } = this.engine.originOffset;
34832
34833
  const { cellSize, color } = this.options;
34833
- for (let x2 = 0;x2 <= width; x2 += cellSize) {
34834
- this.gridGraphics.moveTo(x2, 0).lineTo(x2, height).stroke({ color, width: 0.5 });
34835
- }
34836
- for (let y2 = 0;y2 <= height; y2 += cellSize) {
34837
- this.gridGraphics.moveTo(0, y2).lineTo(width, y2).stroke({ color, width: 0.5 });
34834
+ const left = -ox;
34835
+ const top = -oy;
34836
+ const right = width - ox;
34837
+ const bottom = height - oy;
34838
+ const startX = Math.ceil(left / cellSize) * cellSize;
34839
+ const startY = Math.ceil(top / cellSize) * cellSize;
34840
+ for (let x2 = startX;x2 <= right; x2 += cellSize) {
34841
+ this.gridGraphics.moveTo(x2, top).lineTo(x2, bottom).stroke({ color, width: 0.5 });
34842
+ }
34843
+ for (let y2 = startY;y2 <= bottom; y2 += cellSize) {
34844
+ this.gridGraphics.moveTo(left, y2).lineTo(right, y2).stroke({ color, width: 0.5 });
34838
34845
  }
34839
34846
  }
34840
34847
  destroy() {
@@ -1 +1 @@
1
- {"version":3,"file":"GridPlugin.d.ts","sourceRoot":"","sources":["../../src/plugins/GridPlugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE7D,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACj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O,CAAC,YAAY,CAAY;IAChC,OAAO,CAAC,OAAO,CAA8B;IAC7C,OAAO,CAAC,aAAa,CAAsB;gBAE/B,OAAO,CAAC,EAAE,iBAAiB;IAIvC,IAAI,QAAQ,IAAI,MAAM,CAAkC;IACxD,IAAI,QAAQ,CAAC,KAAK,EAAE,MAAM,EAGzB;IAED,IAAI,WAAW,IAAI,OAAO,CAAqC;IAC/D,IAAI,WAAW,CAAC,KAAK,EAAE,OAAO,EAAuC;IAErE,IAAI,OAAO,IAAI,OAAO,CAAiC;IACvD,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAGzB;IAED,IAAI,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI;IAmBnC,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAIhC,OAAO,CAAC,QAAQ;IAgChB,OAAO,IAAI,IAAI;CAIhB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixi-watchface-engine",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "A PixiJS v8 watchface editor engine with visual editor, plugin system, and intuitive API",
5
5
  "author": "Eric Schmar (ericschmar@gmail.com)",
6
6
  "type": "module",