Fix #127352: Image Editor mask Frame Selected wrong on non-square image

Was not taking image size/aspect into account.
Luckily, we have `BKE_mask_coord_to_image` which can do exactly that, so
use it.

NOTE: probably oversight in 96d9801423

Pull Request: https://projects.blender.org/blender/blender/pulls/135790
This commit is contained in:
Philipp Oeser
2025-03-11 15:23:41 +01:00
committed by Philipp Oeser
parent 9fd67803dc
commit 45949cffe2

View File

@@ -45,6 +45,7 @@
#include "BKE_layer.hh"
#include "BKE_lib_id.hh"
#include "BKE_main.hh"
#include "BKE_mask.h"
#include "BKE_packedFile.hh"
#include "BKE_report.hh"
#include "BKE_scene.hh"
@@ -970,6 +971,8 @@ static int image_view_selected_exec(bContext *C, wmOperator * /*op*/)
if (!ED_mask_selected_minmax(C, min, max, false)) {
return OPERATOR_CANCELLED;
}
BKE_mask_coord_to_image(sima->image, &sima->iuser, min, min);
BKE_mask_coord_to_image(sima->image, &sima->iuser, max, max);
}
rctf bounds{};
bounds.xmin = min[0];