Fix #108098: GPencil: Prevent overwriting mvalo #108172

Merged
YimingWu merged 2 commits from ChengduLittleA/blender:fix-108098 into main 2023-05-26 03:30:22 +02:00
Member

There are other events besides MOUSEMOVE that's passed in during modal
handling, causes the tgpi->mvalo variable to be overwritten without
moving the stroke in the first place, this results in inaccurate offsets
during mouse/pen grabbing in primitive gizmo IN_MOVE mode. Now fixed.

Also fixed the operator hint to include the grab functionality.

There are other events besides `MOUSEMOVE` that's passed in during modal handling, causes the `tgpi->mvalo` variable to be overwritten without moving the stroke in the first place, this results in inaccurate offsets during mouse/pen grabbing in primitive gizmo `IN_MOVE` mode. Now fixed. Also fixed the operator hint to include the grab functionality.
YimingWu added 1 commit 2023-05-23 11:41:16 +02:00
c12e788479 Fix #108098: GPencil: Prevent overwriting `mvalo`
There are other events besides `MOUSEMOVE` that's passed in during modal
handling, causes the `tgpi->mvalo` variable to be overwritten without
moving the stroke in the first place, this results in inaccurate offsets
during mouse/pen grabbing in primitive gizmo `IN_MOVE` mode. Now fixed.

Also fixed the operator hint to include the grab functionality.
YimingWu added this to the Grease Pencil project 2023-05-23 11:41:27 +02:00
YimingWu added the
Module
Grease Pencil
label 2023-05-23 11:41:37 +02:00
Sebastian Parborg reviewed 2023-05-23 15:32:40 +02:00
@ -1619,3 +1620,3 @@
if (tgpi->flag == IN_MOVE) {
int handled = 1;

I think this needs a better variable name.
What is handled exactly?

From the pull request description, this seems like it should be a boolean instead of an int and be named something like mouse_moved. If it moved you want to overwrite mvalo otherwise you do not want to do that.

Is the logic here right as well?
Now it seems like it will still overwrite mvalo if you escape or left click.

I think this needs a better variable name. What is handled exactly? From the pull request description, this seems like it should be a boolean instead of an `int` and be named something like `mouse_moved`. If it moved you want to overwrite `mvalo` otherwise you do not want to do that. Is the logic here right as well? Now it seems like it will still overwrite `mvalo` if you escape or left click.
Author
Member

Humm the escape thing obviously cancels stuff so no big deal, otherwise those are mouse events so there will always be valid mval. I think what I meant there is more "we processed this event so we can overwrite the last position", since it's more about "stop rouge events from writing this variable".

bool seems more appropriate yes.

Humm the escape thing obviously cancels stuff so no big deal, otherwise those are mouse events so there will always be valid `mval`. I think what I meant there is more "we processed this event so we can overwrite the last position", since it's more about "stop rouge events from writing this variable". `bool` seems more appropriate yes.

Perhaps is_mouse_event is better then?

Perhaps `is_mouse_event` is better then?
ChengduLittleA marked this conversation as resolved
YimingWu added 1 commit 2023-05-25 03:37:24 +02:00
Sebastian Parborg approved these changes 2023-05-25 14:22:47 +02:00
Sebastian Parborg left a comment
Member

LGTM

LGTM
YimingWu merged commit 99df159ce0 into main 2023-05-26 03:30:22 +02:00
YimingWu deleted branch fix-108098 2023-05-26 03:30:23 +02:00
Howard Trickey referenced this issue from a commit 2023-05-29 02:51:36 +02:00
Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#108172
No description provided.