Fix #117572: Top vertical scrollbar tool not working properly #117685
No reviewers
Labels
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
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#117685
Loading…
Reference in New Issue
No description provided.
Delete Branch "lichtwerk/blender:117572"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Followup to
ed556113ce
The issue
ed556113ce
was trying to solve was that custom masks forscrollers were used for drawing but not for mouse interaction (so
interaction was not matching drawing in some cases, namely the File
Browser and Spreadsheet).
This was done by "re-using" what was written to v2d->hor & v2d->vert (in
drawing) as a new mask (in interaction). This caused a problem since
this already includes not only those custom masks but other stuff, too.
For example,
view2d_masks
shrinks the rect whenV2D_SCROLL_VERTICAL_HANDLES is used, after
ed556113ce
this waseffectively done twice.
To resolve, revert the way
ed556113ce
was "re-using" what was written tov2d->hor & v2d->vert and instead use the exact same masks that the
FileBrowser and the Spreadsheet set up for drawing in mouse interaction
as well. This way the masks match perfectly for both cases (and we can
fully recalculate all v2d extends without reusing anything that we
shouldnt).
I'm not familiar with this area, just trying to come up with something helpful to say. Mainly it seems nice to avoid checking for specific editor types in
scroller_activate_init
@ -1917,0 +1916,4 @@
ScrArea *area = CTX_wm_area(C);
rcti scroller_mask;
bool use_scroller_mask = false;
if (area->spacetype == SPACE_FILE) {
Putting checks for specific space types in the 2D view code is a bit hacky/ugly. It's a leaky abstraction that would be nice to avoid.
Hm, if an editor can mess with v2d data on its own behalf (without letting a trace that it did), I am not sure how this could be handled better? But if it did, we have to make sure we can repeat the same modifications it did for drawing for mouse interaction as well, no?
Maybe @ideasman42 has a better idea?
Hmm, okay. Thanks for bearing with me. Would an alternative be storing information in the View2D that told it enough information about the scrollers? I guess scrolling (part of?)
scroller_mask
there? I'd usually try not to store things that can just be computed from scratch, but these are two very different code paths. I'm basically just trying to think of a way to make this not add complexity long term.guess this could be done, would appreciate feedback from others if putting additional stuff into View2D is preferred
Maybe I am misunderstanding, but would this be helped with an optional SpaceType callback that returns this rect? Then instead of testing for a specific spacetype just check for the callback?
@Harley : think a spacetype callback is too general, this (at least in theory) could have multiple regions with scrollers (each could have set up own masks)
For reference,
rcti vert, hor
is already for scrollbars, it is just that these are set from one place for drawing and recalculated for interaction.ed556113ce
reused those rects, but then again there is this case ofV2D_SCROLL_VERTICAL_HANDLES
inview2d_masks
which does not fit the current approach (but I think I already explained that?).@ -462,7 +473,6 @@ static void spreadsheet_main_region_draw(const bContext *C, ARegion *region)
spreadsheet_layout.index_column_width = get_index_column_width(tot_rows);
spreadsheet_layout.row_indices = spreadsheet_filter_rows(
*sspreadsheet, spreadsheet_layout, *data_source, scope);
Unrelated change
@ -431,6 +431,17 @@ static void update_visible_columns(ListBase &columns, DataSource &data_source)
});
}
void ED_spreadsheet_layout_maskrect(const SpaceSpreadsheet *sspreadsheet,
Return
rcti
by value, make pointers into references@ -16,13 +20,14 @@
#include "spreadsheet_draw.hh"
#define CELL_RIGHT_PADDING (2.0f * UI_SCALE_FAC)
#define TOP_ROW_HEIGHT (UI_UNIT_Y * 1.1f)
Unnecessary change moving this to a define? Or sort of seems like this is conflicting with the one in
ED_spreadsheet.hh
I can think of other approaches as well:
view2d_masks
and into respective editors drawing code (make a maskrect there)-- it is a bit of a weak assumption anyways (should depend more on the editor itself, not only the fact that
V2D_SCROLL_VERTICAL_HANDLES
is used-- this way it would only be done once, not twice
-- (I dont like this solution much since it still reuse previously calculated rects for
View2D
vert
/hor
when re-calculating them from scratch [the weak hack fromed556113ce
])UI_view2d_scrollers_draw
and do all specific editor cases insideview2d_scrollers_calc
-- ensures this is consistent across drawing and interaction code
Submitted !117984 as an alternative. It avoids & removes special handling inside
View2D
and lets editors control the scroller masks fully. The way we reconstruct the custom scroller mask insidescroller_activate_init()
seems reliable to me. If it causes issues we can still store the custom mask (noted in comment).OK, that is basically what I suggested in my previous comment in [1], fine with that as well (and thx putting the PR up), will leave a comment in !117984
Think we can close this one already then.
Pull request closed