This commit is contained in:
Nicola
2021-12-11 10:48:14 +01:00
parent dfa9810a75
commit a238fb1b47
7 changed files with 117 additions and 65 deletions

View File

@ -3,7 +3,7 @@ class PixelGrid extends Layer {
// Start colour of the pixel grid (can be changed in the preferences)
pixelGridColor = "#000000";
// Distance between one line and another in HTML pixels
lineDistance = 11;
lineDistance = 10;
// The grid is not visible by default
pixelGridVisible = false;
// The grid is enabled, but is disabled in order to save performance with big sprites
@ -82,6 +82,8 @@ class PixelGrid extends Layer {
this.context.strokeStyle = Settings.getCurrSettings().pixelGridColour;
console.log("Line ditance: " + this.lineDistance)
// OPTIMIZABLE, could probably be a bit more elegant
// Draw horizontal lines
for (let i=0; i<this.canvas.width / Math.round(this.lineDistance); i++) {