mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
add user setting for seamless mode opacity
This commit is contained in:
@@ -35,6 +35,7 @@
|
||||
this.getZoom(),
|
||||
this.getGridWidth(),
|
||||
pskl.UserSettings.get('SEAMLESS_MODE'),
|
||||
pskl.UserSettings.get('SEAMLESS_OPACITY'),
|
||||
offset.x, offset.y,
|
||||
size.width, size.height,
|
||||
frame.getHash()
|
||||
|
||||
@@ -293,7 +293,9 @@
|
||||
* differentiate those additional frames from the main frame.
|
||||
*/
|
||||
ns.FrameRenderer.prototype.drawTiledFrames_ = function (context, image, w, h, z) {
|
||||
context.fillStyle = Constants.SEAMLESS_MODE_OVERLAY_COLOR;
|
||||
var opacity = pskl.UserSettings.get('SEAMLESS_OPACITY');
|
||||
opacity = pskl.utils.Math.minmax(opacity, 0, 1);
|
||||
context.fillStyle = 'rgba(255, 255, 255, ' + opacity + ')';
|
||||
[[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.fillRect(d[0] * w * z, d[1] * h * z, w * z, h * z);
|
||||
|
||||
Reference in New Issue
Block a user