mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
466eb0580c
- Can now zoom without selecting the zom tool - Moved updateCursor to the tool class, deleted _updateCursor.js - Removed as many references to canvas as possible, removed every global reference to context - Added methods in Tool class to move the brush preview
45 lines
1.3 KiB
JavaScript
45 lines
1.3 KiB
JavaScript
//init variables
|
|
var canvasSize,zoom;
|
|
var dragging = false;
|
|
var lastMouseClickPos = [0,0];
|
|
var dialogueOpen = false;
|
|
var documentCreated = false;
|
|
var pixelEditorMode;
|
|
|
|
// Checkerboard management
|
|
// Checkerboard color 1
|
|
var firstCheckerBoardColor = 'rgba(179, 173, 182, 1)';
|
|
// Checkerboard color 2
|
|
var secondCheckerBoardColor = 'rgba(204, 200, 206, 1)';
|
|
// Square size for the checkerboard
|
|
var checkerBoardSquareSize = 16;
|
|
// Checkerboard canvas
|
|
var checkerBoardCanvas = document.getElementById('checkerboard');
|
|
|
|
//common elements
|
|
var brushPreview = document.getElementById("brush-preview");
|
|
var eyedropperPreview = document.getElementById("eyedropper-preview");
|
|
var canvasView = document.getElementById("canvas-view");
|
|
var colors = document.getElementsByClassName("color-button");
|
|
var colorsMenu = document.getElementById("colors-menu");
|
|
var popUpContainer = document.getElementById("pop-up-container");
|
|
|
|
// main canvas
|
|
var canvas = document.getElementById('pixel-canvas');
|
|
var currentGlobalColor;
|
|
|
|
// Layers
|
|
var layers = [];
|
|
// Currently selected layer
|
|
var currentLayer;
|
|
|
|
// VFX layer used to draw previews of the selection and things like that
|
|
var VFXLayer;
|
|
// VFX canvas
|
|
var VFXCanvas = document.getElementById('vfx-canvas');
|
|
|
|
// TMP layer
|
|
var TMPLayer;
|
|
// TMP canvas
|
|
var TMPCanvas = document.getElementById('tmp-canvas');
|