mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Issue #470: move the seamless overlay color to Constants.js
This commit is contained in:
parent
21b2261a9d
commit
5533664900
@ -21,6 +21,7 @@ var Constants = {
|
|||||||
|
|
||||||
DEFAULT_PEN_COLOR : '#000000',
|
DEFAULT_PEN_COLOR : '#000000',
|
||||||
TRANSPARENT_COLOR : 'rgba(0, 0, 0, 0)',
|
TRANSPARENT_COLOR : 'rgba(0, 0, 0, 0)',
|
||||||
|
SEAMLESS_MODE_OVERLAY_COLOR : 'rgba(255, 255, 255, 0.5)',
|
||||||
|
|
||||||
CURRENT_COLORS_PALETTE_ID : '__current-colors',
|
CURRENT_COLORS_PALETTE_ID : '__current-colors',
|
||||||
|
|
||||||
|
@ -259,9 +259,9 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (pskl.UserSettings.get('TILED_PREVIEW')) {
|
if (pskl.UserSettings.get('TILED_PREVIEW')) {
|
||||||
displayContext.clearRect(-1 * w * z, -1 * h * z, 3 * w * z, 3 * h * z);
|
displayContext.clearRect(-1 * w * z, -1 * h * z, 3 * w * z, 3 * h * z);
|
||||||
} else {
|
} else {
|
||||||
displayContext.clearRect(0, 0, w * z, h * z);
|
displayContext.clearRect(0, 0, w * z, h * z);
|
||||||
}
|
}
|
||||||
|
|
||||||
var gridWidth = this.computeGridWidthForDisplay_();
|
var gridWidth = this.computeGridWidthForDisplay_();
|
||||||
@ -284,8 +284,13 @@
|
|||||||
displayContext.restore();
|
displayContext.restore();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw repeatedly the provided image around the main drawing area. Used for seamless
|
||||||
|
* drawing mode, to easily create seamless textures. A colored overlay is applied to
|
||||||
|
* differentiate those additional frames from the main frame.
|
||||||
|
*/
|
||||||
ns.FrameRenderer.prototype.drawTiledFrames_ = function (context, image, w, h, z) {
|
ns.FrameRenderer.prototype.drawTiledFrames_ = function (context, image, w, h, z) {
|
||||||
context.fillStyle = 'rgba(255,255,255,0.5)';
|
context.fillStyle = Constants.SEAMLESS_MODE_OVERLAY_COLOR;
|
||||||
[[0, -1], [0, 1], [-1, -1], [-1, 0], [-1, 1], [1, -1], [1, 0], [1, 1]].forEach(function (d) {
|
[[0, -1], [0, 1], [-1, -1], [-1, 0], [-1, 1], [1, -1], [1, 0], [1, 1]].forEach(function (d) {
|
||||||
context.drawImage(image, d[0] * w * z, d[1] * h * z);
|
context.drawImage(image, d[0] * w * z, d[1] * h * z);
|
||||||
context.fillRect(d[0] * w * z, d[1] * h * z, w * z, h * z);
|
context.fillRect(d[0] * w * z, d[1] * h * z, w * z, h * z);
|
||||||
|
Loading…
Reference in New Issue
Block a user