Page MenuHome

Popovers scroll arrows glitch
Confirmed, LowPublicBUG

Description

System Information
Operating system: Darwin-18.2.0-x86_64-i386-64bit 64 Bits
Graphics card: AMD Radeon Pro 455 OpenGL Engine ATI Technologies Inc. 4.1 ATI-2.4.10

Blender Version
Broken: version: 2.80 (sub 72), branch: blender2.7, commit date: 2019-05-29 18:17, hash: rBfee600f47980

Short description of error

When you scroll popovers, the content goes beyond the boundaries:

The active area of scroll arrows that responds to mouse hover is shifted:


There is an offset for backdrop, in ui_draw_popover_back_impl, but not for the content itself, this causes this error.

rect->ymax -= unit_half;
rect->ymin += unit_half;

Event Timeline

Campbell Barton (campbellbarton) lowered the priority of this task from 90 to Low.Jun 6 2019, 9:07 AM

There is an offset for backdrop, in ui_draw_popover_back_impl, but not for the content itself, this causes this error.

rect->ymax -= unit_half;
rect->ymin += unit_half;
Richard Antalik (ISS) changed the task status from Confirmed to Needs Information from User.Tue, Feb 4, 6:24 AM

I have re-triaged this report and can not reproduce it.
Can you please check if this is still an issue in latest build?
https://builder.blender.org/download/

It's become less noticeable after the D6483, but it's still here.

You can just check where the on mouse hover scrolling active zone is, and see it is shifted relative to the arrow that marks it.

Anyway, I have a patch for that. I think @Brecht Van Lommel (brecht) can take a look at this.
Maybe there's a more elegant solution.

diff --git a/source/blender/editors/interface/interface_region_popup.c b/source/blender/editors/interface/interface_region_popup.c
index 867ac652505..56652bf170a 100644
--- a/source/blender/editors/interface/interface_region_popup.c
+++ b/source/blender/editors/interface/interface_region_popup.c
@@ -708,6 +708,15 @@ uiBlock *ui_popup_block_refresh(bContext *C,
     }
   }
   else {
+    /* Add an offset to draw the popover arrow. */
+    if ((block->flag & UI_BLOCK_POPOVER) && ELEM(block->direction, UI_DIR_UP, UI_DIR_DOWN)) {
+      /* Keep sync with the 'ui_draw_popover_back'. */
+      const float unit_size = U.widget_unit / block->aspect;
+      const float unit_half = unit_size * (block->direction == UI_DIR_DOWN ? 0.5 : -0.5);
+
+      UI_block_translate(block, 0, -unit_half);
+    }
+
     /* clip block with window boundary */
     ui_popup_block_clip(window, block);
 
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 92032c3b18c..8c28b29f5ab 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -4970,8 +4970,6 @@ static void ui_draw_popover_back_impl(const uiWidgetColors *wcol,
                                              rect->xmin + unit_size,
                                              rect->xmax - unit_size) :
                                      BLI_rcti_cent_x(rect);
-  rect->ymax -= unit_half;
-  rect->ymin += unit_half;
 
   GPU_blend(true);
Richard Antalik (ISS) changed the task status from Needs Information from User to Confirmed.Tue, Feb 4, 8:11 PM
Richard Antalik (ISS) changed the subtype of this task from "Report" to "Bug".
Richard Antalik (ISS) edited projects, added User Interface; removed Tracker Curfew.

This patch adds spacing to the top over every popover, also without scrolling, and it doesn't look good.

I think somehow this should only be done when scrolling somehow?

The patch can also be simplified by using:

UI_block_translate(block, 0, -unit_half);

There is another problem, when you scroll down the popover and then go back it doesn't return to the original position, the margin gets smaller.

Now (initially open vs scrolled):

After patch above (initially open vs scrolled):

Ok, this extra offset comes from ui_menu_scroll_apply_offset_y.