🪲 Clamp pointer position of pixel wipe and incinerate effect on KWin
This commit is contained in:
@@ -7,10 +7,10 @@ let startPos = seed[0] > seed[1] ? [seed[0], Math.floor(seed[1] + 0.5)] :
|
|||||||
|
|
||||||
if (effect.readConfig('UsePointer', true)) {
|
if (effect.readConfig('UsePointer', true)) {
|
||||||
startPos = [
|
startPos = [
|
||||||
(effects.cursorPos.x - window.x) / window.width,
|
Math.min(1.0, Math.max(0.0, (effects.cursorPos.x - window.x) / window.width)),
|
||||||
(effects.cursorPos.y - window.y) / window.height
|
Math.min(1.0, Math.max(0.0, (effects.cursorPos.y - window.y) / window.height))
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
effect.setUniform(this.shader, 'uSeed', seed);
|
effect.setUniform(this.shader, 'uSeed', seed);
|
||||||
effect.setUniform(this.shader, 'uStartPos', startPos);
|
effect.setUniform(this.shader, 'uStartPos', startPos);
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
// The code below is called whenever a window is closed or opened.
|
// The code below is called whenever a window is closed or opened.
|
||||||
|
|
||||||
let startPos = [
|
let startPos = [
|
||||||
(effects.cursorPos.x - window.x) / window.width,
|
Math.min(1.0, Math.max(0.0, (effects.cursorPos.x - window.x) / window.width)),
|
||||||
(effects.cursorPos.y - window.y) / window.height
|
Math.min(1.0, Math.max(0.0, (effects.cursorPos.y - window.y) / window.height))
|
||||||
];
|
];
|
||||||
|
|
||||||
effect.setUniform(this.shader, 'uStartPos', startPos);
|
effect.setUniform(this.shader, 'uStartPos', startPos);
|
||||||
|
|||||||
Reference in New Issue
Block a user