mirror of
https://github.com/lkwq007/stablediffusion-infinity.git
synced 2025-01-09 04:17:37 +08:00
Fix eraser when mousedown
This commit is contained in:
parent
ad4281ce68
commit
f85c44911b
3
app.py
3
app.py
@ -819,11 +819,12 @@ with blocks as demo:
|
||||
label="Init Mode",
|
||||
choices=[
|
||||
"patchmatch",
|
||||
"g_diffuser",
|
||||
"edge_pad",
|
||||
"cv2_ns",
|
||||
"cv2_telea",
|
||||
"perlin",
|
||||
"gaussian",
|
||||
"g_diffuser",
|
||||
],
|
||||
value="patchmatch",
|
||||
type="value",
|
||||
|
@ -200,7 +200,7 @@ class InfCanvas:
|
||||
def handle_mouse_down(event):
|
||||
self.mouse_state = get_mouse_mode()
|
||||
if self.mouse_state==BRUSH_MODE:
|
||||
x,y=get_event_pos()
|
||||
x,y=get_event_pos(event)
|
||||
self.use_eraser(x,y)
|
||||
|
||||
def handle_mouse_out(event):
|
||||
|
@ -372,8 +372,7 @@ async def message_func(event):
|
||||
elif event.data[0]=="mode":
|
||||
if event.data[1]!="selection":
|
||||
await sync_func(event)
|
||||
if event.data[1]!="eraser":
|
||||
await eraser_func(event)
|
||||
await eraser_func(event)
|
||||
document.querySelector("#mode").value=event.data[1]
|
||||
elif event.data[0]=="transfer":
|
||||
await transfer_func(event)
|
||||
|
@ -68,7 +68,8 @@ open_setting = function() {
|
||||
Save() {
|
||||
this.validate();
|
||||
let record = this.getCleanRecord();
|
||||
window.postMessage(["resize",record.width,record.height],"*");
|
||||
window.postMessage(["resize",record.canvas_width,record.canvas_height],"*");
|
||||
w2popup.close();
|
||||
},
|
||||
custom: {
|
||||
text: "Cancel",
|
||||
@ -284,6 +285,7 @@ var toolbar=new w2toolbar({
|
||||
break;
|
||||
case "load":
|
||||
query("#upload_state").click();
|
||||
this.selection_box=null;
|
||||
this.setCount("resize_selection","");
|
||||
break;
|
||||
case "next":
|
||||
|
Loading…
Reference in New Issue
Block a user