UI: Improvement to screen_find_area_xy #104680

Merged
Harley Acheson merged 1 commits from Harley/blender:FindArea into main 2023-02-16 02:39:07 +01:00
Member

In BKE_screen_area_map_find_area_xy (find a ScrArea by 2D location),
ignore edges by using screen verts instead of totrct


We sometimes want to know which editor (ScrArea) is under the current mouse location. However the function treats the editor edges (black borders) as unknown no-mans land belonging to nobody. In the following capture you will see that the Join Area operator gives a "stopsign" cursor at the very middle of the shared edge:

FindArea1.gif

But this isn't correct behavior in that screen edges are just a visual construct. Editors do not really have any gaps between them, not even a pixel. Every part of every window is covered by some editor, bounded by their (often shared) screen verts. It is just that we inset from that outer boundary to create a totrct that contains the inner bounds.

This patch just uses the area's screen verts (outer bounds) instead of the inner bounds, and therefore always ignores edges when finding areas:

FindArea2.gif

In BKE_screen_area_map_find_area_xy (find a ScrArea by 2D location), ignore edges by using screen verts instead of totrct --- We sometimes want to know which editor (ScrArea) is under the current mouse location. However the function treats the editor edges (black borders) as unknown no-mans land belonging to nobody. In the following capture you will see that the Join Area operator gives a "stopsign" cursor at the very middle of the shared edge: ![FindArea1.gif](/attachments/e40357e9-e661-401f-a61f-5d9a64cf84ec) But this isn't correct behavior in that screen edges are just a visual construct. Editors do not really have any gaps between them, not even a pixel. Every part of every window is covered by some editor, bounded by their (often shared) screen verts. It is just that we inset from that outer boundary to create a totrct that contains the inner bounds. This patch just uses the area's screen verts (outer bounds) instead of the inner bounds, and therefore always ignores edges when finding areas: ![FindArea2.gif](/attachments/04d3315f-f9fb-4992-8f5b-96029f934ff0)
Brecht Van Lommel approved these changes 2023-02-13 08:35:56 +01:00
Brecht Van Lommel added this to the User Interface project 2023-02-13 09:06:29 +01:00
Harley Acheson force-pushed FindArea from a7b162a883 to 6ce4f2f895 2023-02-16 01:17:35 +01:00 Compare
Author
Member

@blender-bot build

@blender-bot build
Harley Acheson merged commit c39b81d832 into main 2023-02-16 02:39:07 +01:00
Harley Acheson deleted branch FindArea 2023-02-16 02:39:08 +01: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#104680
No description provided.