Fix #113726: Unable to open N panel for the first time with click drag
View2D isn't initialized in these regions yet, which is a valid state for hidden regions. So consider that when calculating the region zoom factor in the region scale operator.
This commit is contained in:
@@ -2862,8 +2862,10 @@ static int region_scale_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
/* execute the events */
|
||||
switch (event->type) {
|
||||
case MOUSEMOVE: {
|
||||
const float aspect = BLI_rctf_size_x(&rmd->region->v2d.cur) /
|
||||
(BLI_rcti_size_x(&rmd->region->v2d.mask) + 1);
|
||||
const float aspect = (rmd->region->v2d.flag & V2D_IS_INIT) ?
|
||||
(BLI_rctf_size_x(&rmd->region->v2d.cur) /
|
||||
(BLI_rcti_size_x(&rmd->region->v2d.mask) + 1)) :
|
||||
1.0f;
|
||||
const int snap_size_threshold = (U.widget_unit * 2) / aspect;
|
||||
bool size_changed = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user