blender-v3.3-release backports #115848

Merged
Philipp Oeser merged 3 commits from lichtwerk/blender:blender-v3.3-release into blender-v3.3-release 2023-12-06 16:15:47 +01:00
3 changed files with 11 additions and 2 deletions

View File

@ -1543,7 +1543,7 @@ void OptiXDevice::build_bvh(BVH *bvh, Progress &progress, bool refit)
if (geom->geometry_type == Geometry::HAIR) {
/* Build BLAS for curve primitives. */
Hair *const hair = static_cast<Hair *const>(geom);
if (hair->num_curves() == 0) {
if (hair->num_segments() == 0) {
return;
}

View File

@ -5902,6 +5902,10 @@ static int ui_do_but_SCROLL(
const bool is_motion = (event->type == MOUSEMOVE);
if (ui_numedit_but_SLI(
but, data, (horizontal) ? mx : my, horizontal, is_motion, false, false)) {
/* Scrollbars in popups need UI layout refresh to update the right items to show. */
if (ui_block_is_popup_any(but->block)) {
ED_region_tag_refresh_ui(data->region);
}
ui_numedit_apply(C, block, but, data);
}
}

View File

@ -1850,7 +1850,12 @@ static void scroller_activate_init(bContext *C,
* - zooming must be allowed on this axis, otherwise, default to pan
*/
View2DScrollers scrollers;
UI_view2d_scrollers_calc(v2d, nullptr, &scrollers);
/* Some Editors like the Filebrowser or Spreadsheet already set up custom masks for scrollbars
* (they dont cover the whole region width or height), these need to be considered, otherwise
* coords for `mouse_in_scroller_handle` later are not compatible. */
rcti scroller_mask = v2d->hor;
BLI_rcti_union(&scroller_mask, &v2d->vert);
UI_view2d_scrollers_calc(v2d, &scroller_mask, &scrollers);
/* Use a union of 'cur' & 'tot' in case the current view is far outside 'tot'. In this cases
* moving the scroll bars has far too little effect and the view can get stuck T31476. */