Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_region_hud.cc
| Show First 20 Lines • Show All 137 Lines • ▼ Show 20 Lines | |||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Callbacks for Floating Region | /** \name Callbacks for Floating Region | ||||
| * \{ */ | * \{ */ | ||||
| static void hud_region_init(wmWindowManager *wm, ARegion *region) | static void hud_region_init(wmWindowManager *wm, ARegion *region) | ||||
| { | { | ||||
| ED_region_panels_init(wm, region); | ED_region_panels_init(wm, region); | ||||
| /* Reset zoom from panels init because we don't want zoom allowed for redo panel. */ | |||||
| region->v2d.maxzoom = 1.0f; | |||||
| region->v2d.minzoom = 1.0f; | |||||
| UI_region_handlers_add(®ion->handlers); | UI_region_handlers_add(®ion->handlers); | ||||
| region->flag |= RGN_FLAG_TEMP_REGIONDATA; | region->flag |= RGN_FLAG_TEMP_REGIONDATA; | ||||
| } | } | ||||
| static void hud_region_free(ARegion *region) | static void hud_region_free(ARegion *region) | ||||
| { | { | ||||
| MEM_SAFE_FREE(region->regiondata); | MEM_SAFE_FREE(region->regiondata); | ||||
| } | } | ||||
| Show All 26 Lines | if (region->panels.first && | ||||
| } | } | ||||
| region->winx = winx_new; | region->winx = winx_new; | ||||
| region->winy = winy_new; | region->winy = winy_new; | ||||
| region->winrct.xmax = (region->winrct.xmin + region->winx) - 1; | region->winrct.xmax = (region->winrct.xmin + region->winx) - 1; | ||||
| region->winrct.ymax = (region->winrct.ymin + region->winy) - 1; | region->winrct.ymax = (region->winrct.ymin + region->winy) - 1; | ||||
| UI_view2d_region_reinit(v2d, V2D_COMMONVIEW_LIST, region->winx, region->winy); | UI_view2d_region_reinit(v2d, V2D_COMMONVIEW_LIST, region->winx, region->winy); | ||||
campbellbarton: `don't mess with flags` which flags? Using `V2D_COMMONVIEW_LIST` is working in my tests. | |||||
| /* Weak, but needed to avoid glitches, especially with hi-dpi | /* Weak, but needed to avoid glitches, especially with hi-dpi | ||||
| * (where resizing the view glitches often). | * (where resizing the view glitches often). | ||||
| * Fortunately this only happens occasionally. */ | * Fortunately this only happens occasionally. */ | ||||
| ED_region_panels_layout(C, region); | ED_region_panels_layout(C, region); | ||||
| } | } | ||||
| /* restore view matrix */ | /* restore view matrix */ | ||||
| ▲ Show 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | static ARegion *hud_region_add(ScrArea *area) | ||||
| region->regiontype = RGN_TYPE_HUD; | region->regiontype = RGN_TYPE_HUD; | ||||
| region->alignment = RGN_ALIGN_FLOAT; | region->alignment = RGN_ALIGN_FLOAT; | ||||
| region->overlap = true; | region->overlap = true; | ||||
| region->flag |= RGN_FLAG_DYNAMIC_SIZE; | region->flag |= RGN_FLAG_DYNAMIC_SIZE; | ||||
| if (region_win) { | if (region_win) { | ||||
| float x, y; | float x, y; | ||||
| UI_view2d_scroller_size_get(®ion_win->v2d, &x, &y); | UI_view2d_scroller_size_get(®ion_win->v2d, true, &x, &y); | ||||
| region->runtime.offset_x = x; | region->runtime.offset_x = x; | ||||
| region->runtime.offset_y = y; | region->runtime.offset_y = y; | ||||
| } | } | ||||
| return region; | return region; | ||||
| } | } | ||||
| void ED_area_type_hud_clear(wmWindowManager *wm, ScrArea *area_keep) | void ED_area_type_hud_clear(wmWindowManager *wm, ScrArea *area_keep) | ||||
| ▲ Show 20 Lines • Show All 119 Lines • Show Last 20 Lines | |||||
don't mess with flags which flags? Using V2D_COMMONVIEW_LIST is working in my tests.