[Bf-blender-cvs] [ae28ceb9d86] master: Fix swapped x/y in event simulation script

Campbell Barton noreply at git.blender.org
Wed Jun 2 17:12:50 CEST 2021


Commit: ae28ceb9d86e9db702d968ed779e9bb2b2d31a08
Author: Campbell Barton
Date:   Thu Jun 3 00:53:34 2021 +1000
Branches: master
https://developer.blender.org/rBae28ceb9d86e9db702d968ed779e9bb2b2d31a08

Fix swapped x/y in event simulation script

Incorrect area center calculation, also correct comments.

===================================================================

M	tests/python/bl_run_operators_event_simulate.py

===================================================================

diff --git a/tests/python/bl_run_operators_event_simulate.py b/tests/python/bl_run_operators_event_simulate.py
index e536b9da2b1..251d27fce90 100644
--- a/tests/python/bl_run_operators_event_simulate.py
+++ b/tests/python/bl_run_operators_event_simulate.py
@@ -31,7 +31,7 @@ Possible use cases for this script include:
 
 - Creating reproducible user interactions for the purpose of benchmarking and profiling.
 
-  Note that curse-motion actions report the update time between events
+  Note that cursor-motion actions report the update time between events
   which can be helpful when measuring optimizations.
 
 - As a convenient way to replay interactive actions that reproduce a bug.
@@ -86,7 +86,7 @@ Sculpt stroke:
         'event(type="WHEELDOWNMOUSE", value="TAP", repeat=2)' \
         'event(type="LEFTMOUSE", value="PRESS")' \
         'cursor_motion(path="CIRCLE", radius=300, steps=100, repeat=5)' \
-        'event(type="LEFTMOUSE", value="RELEASE")' \
+        'event(type="LEFTMOUSE", value="RELEASE")'
 
 
 Implementation
@@ -245,8 +245,8 @@ class action_handlers:
         if area is None:
             raise ArgumentTypeError("Area with ui_type=%r not found" % ui_type)
 
-        x = area.y + (area.width // 2)
-        y = area.x + (area.height // 2)
+        x = area.x + (area.width // 2)
+        y = area.y + (area.height // 2)
 
         yield dict(type='MOUSEMOVE', value='NOTHING', x=x, y=y)
         yield dict(type='SPACE', value='TAP', ctrl=True, alt=True)
@@ -549,8 +549,8 @@ def main_event_iter(*, action_list):
     """
     area = find_main_area()
 
-    x_init = area.y + (area.width // 2)
-    y_init = area.x + (area.height // 2)
+    x_init = area.x + (area.width // 2)
+    y_init = area.y + (area.height // 2)
 
     yield dict(type='MOUSEMOVE', value='NOTHING', x=x_init, y=y_init)



More information about the Bf-blender-cvs mailing list