Fix: start position of the selection may be incorrect
This commit is contained in:
parent
bbace1896a
commit
0a29707c3c
|
@ -1,5 +1,5 @@
|
||||||
'''
|
'''
|
||||||
Copyright (C) 2021 - 2024 Akaneyu
|
Copyright (C) 2021 - 2025 Akaneyu
|
||||||
|
|
||||||
This program is free software: you can redistribute it and/or modify
|
This program is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
|
@ -136,6 +136,7 @@ def draw_handler():
|
||||||
|
|
||||||
# release the selection if the image is changed
|
# release the selection if the image is changed
|
||||||
if area_session.selection or area_session.selection_region:
|
if area_session.selection or area_session.selection_region:
|
||||||
|
if area_session.prev_image:
|
||||||
if img != area_session.prev_image:
|
if img != area_session.prev_image:
|
||||||
cancel_selection(context)
|
cancel_selection(context)
|
||||||
|
|
||||||
|
|
|
@ -45,12 +45,14 @@ class IMAGE_EDITOR_PLUS_OT_make_selection(bpy.types.Operator):
|
||||||
|
|
||||||
if area_session.selection_region:
|
if area_session.selection_region:
|
||||||
area_session.selection_region[1] = region_pos
|
area_session.selection_region[1] = region_pos
|
||||||
else:
|
|
||||||
area_session.selection_region = [region_pos, region_pos]
|
|
||||||
|
|
||||||
elif event.type == 'LEFTMOUSE':
|
elif event.type == 'LEFTMOUSE':
|
||||||
if event.value == 'PRESS':
|
if event.value == 'PRESS':
|
||||||
self.lmb = True
|
self.lmb = True
|
||||||
|
|
||||||
|
region_pos = [event.mouse_region_x, event.mouse_region_y]
|
||||||
|
area_session.selection_region = [region_pos, region_pos]
|
||||||
|
|
||||||
elif event.value == 'RELEASE':
|
elif event.value == 'RELEASE':
|
||||||
self.lmb = False
|
self.lmb = False
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue