mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-01-18 18:30:19 +08:00
Fix masked editor issue with firefox on windows.
This commit is contained in:
parent
7e151778a3
commit
bca2f7d2f1
@ -368,7 +368,7 @@ class MaskEditorDialog extends ComfyDialog {
|
|||||||
|
|
||||||
self.updateBrushPreview(self);
|
self.updateBrushPreview(self);
|
||||||
|
|
||||||
if (event instanceof TouchEvent || event.buttons == 1) {
|
if (window.TouchEvent && event instanceof TouchEvent || event.buttons == 1) {
|
||||||
var diff = performance.now() - self.lasttime;
|
var diff = performance.now() - self.lasttime;
|
||||||
|
|
||||||
const maskRect = self.maskCanvas.getBoundingClientRect();
|
const maskRect = self.maskCanvas.getBoundingClientRect();
|
||||||
@ -389,7 +389,7 @@ class MaskEditorDialog extends ComfyDialog {
|
|||||||
brush_size *= event.pressure;
|
brush_size *= event.pressure;
|
||||||
this.last_pressure = event.pressure;
|
this.last_pressure = event.pressure;
|
||||||
}
|
}
|
||||||
else if(event instanceof TouchEvent && diff < 20){
|
else if(window.TouchEvent && event instanceof TouchEvent && diff < 20){
|
||||||
// The firing interval of PointerEvents in Pen is unreliable, so it is supplemented by TouchEvents.
|
// The firing interval of PointerEvents in Pen is unreliable, so it is supplemented by TouchEvents.
|
||||||
brush_size *= this.last_pressure;
|
brush_size *= this.last_pressure;
|
||||||
}
|
}
|
||||||
@ -442,7 +442,7 @@ class MaskEditorDialog extends ComfyDialog {
|
|||||||
brush_size *= event.pressure;
|
brush_size *= event.pressure;
|
||||||
this.last_pressure = event.pressure;
|
this.last_pressure = event.pressure;
|
||||||
}
|
}
|
||||||
else if(event instanceof TouchEvent && diff < 20){
|
else if(window.TouchEvent && event instanceof TouchEvent && diff < 20){
|
||||||
brush_size *= this.last_pressure;
|
brush_size *= this.last_pressure;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user