mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
944cf1fbed
yeah that was the easy part but still - Added hotkeys for copy, paste and cut - Added _copyPaste.js for copy, cut and paste management
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
|
|
|
|
//set the correct cursor for the current tool
|
|
Tool.prototype.updateCursor = function () {
|
|
//console.log('updateCursor()', currentTool)
|
|
|
|
//switch to that tools cursor
|
|
canvasView.style.cursor = this.cursor || 'default';
|
|
|
|
//if the tool uses a brush preview, make it visible and update the size
|
|
if (this.brushPreview) {
|
|
//console.log('brush size',this.currentBrushSize)
|
|
brushPreview.style.display = 'block';
|
|
brushPreview.style.width = this.currentBrushSize * zoom + 'px';
|
|
brushPreview.style.height = this.currentBrushSize * zoom + 'px';
|
|
}
|
|
|
|
//show / hide eyedropper color preview
|
|
if (this.eyedropperPreview) eyedropperPreview.style.display = 'block';
|
|
else eyedropperPreview.style.display = 'none';
|
|
|
|
//moveSelection
|
|
if (currentTool.name == 'moveselection') {
|
|
if (cursorInSelectedArea()) {
|
|
canMoveSelection = true;
|
|
canvasView.style.cursor = 'move';
|
|
brushPreview.style.display = 'none';
|
|
}
|
|
else {
|
|
canvasView.style.cursor = 'crosshair';
|
|
}
|
|
}
|
|
}
|
|
|
|
/*global Tool, dragging, canvasView, brushPreview, canMoveSelection, cursorInSelectedArea, eyedropperPreview, zoom, currentTool */
|