Fix T51845

This commit is contained in:
Aleksandr Zinovev 2017-06-23 11:04:58 +03:00
parent 7abed4e433
commit bddb4de47c
Notes: blender-bot 2023-02-14 06:52:15 +01:00
Referenced by issue #51845, UI Scale cause double width vertical borders
3 changed files with 10 additions and 1 deletions

View File

@ -97,6 +97,7 @@ void BLI_rctf_union(struct rctf *rctf1, const struct rctf *rctf2);
void BLI_rcti_rctf_copy(struct rcti *dst, const struct rctf *src);
void BLI_rctf_rcti_copy(struct rctf *dst, const struct rcti *src);
void BLI_rcti_rctf_copy_floor(struct rcti *dst, const struct rctf *src);
void BLI_rcti_rctf_copy_round(struct rcti *dst, const struct rctf *src);
void BLI_rctf_rotate_expand(rctf *dst, const rctf *src, const float angle);

View File

@ -693,6 +693,14 @@ void BLI_rcti_rctf_copy_floor(rcti *dst, const rctf *src)
dst->ymax = floorf(src->ymax);
}
void BLI_rcti_rctf_copy_round(rcti *dst, const rctf *src)
{
dst->xmin = floorf(src->xmin + 0.5f);
dst->xmax = floorf(src->xmax + 0.5f);
dst->ymin = floorf(src->ymin + 0.5f);
dst->ymax = floorf(src->ymax + 0.5f);
}
void BLI_rctf_rcti_copy(rctf *dst, const rcti *src)
{
dst->xmin = src->xmin;

View File

@ -1337,7 +1337,7 @@ static void ui_but_to_pixelrect(rcti *rect, const ARegion *ar, uiBlock *block, u
rctf rectf;
ui_block_to_window_rctf(ar, block, &rectf, (but) ? &but->rect : &block->rect);
BLI_rcti_rctf_copy(rect, &rectf);
BLI_rcti_rctf_copy_round(rect, &rectf);
BLI_rcti_translate(rect, -ar->winrct.xmin, -ar->winrct.ymin);
}