forked from bartvdbraak/blender
Fix #34357: image editor scope and clip editor track preview did not resize
properly with different DPI settings.
This commit is contained in:
parent
7ae17e9ed4
commit
ce54cc111d
@ -4253,7 +4253,7 @@ static int ui_numedit_but_HISTOGRAM(uiBut *but, uiHandleButtonData *data, int mx
|
||||
|
||||
if (in_scope_resize_zone(but, data->dragstartx, data->dragstarty)) {
|
||||
/* resize histogram widget itself */
|
||||
hist->height = BLI_rctf_size_y(&but->rect) + (data->dragstarty - my);
|
||||
hist->height = (BLI_rctf_size_y(&but->rect) + (data->dragstarty - my))/UI_DPI_FAC;
|
||||
}
|
||||
else {
|
||||
/* scale histogram values (dy / 10 for better control) */
|
||||
@ -4337,7 +4337,7 @@ static int ui_numedit_but_WAVEFORM(uiBut *but, uiHandleButtonData *data, int mx,
|
||||
|
||||
if (in_scope_resize_zone(but, data->dragstartx, data->dragstarty)) {
|
||||
/* resize waveform widget itself */
|
||||
scopes->wavefrm_height = BLI_rctf_size_y(&but->rect) + (data->dragstarty - my);
|
||||
scopes->wavefrm_height = (BLI_rctf_size_y(&but->rect) + (data->dragstarty - my))/UI_DPI_FAC;
|
||||
}
|
||||
else {
|
||||
/* scale waveform values */
|
||||
@ -4419,7 +4419,7 @@ static int ui_numedit_but_VECTORSCOPE(uiBut *but, uiHandleButtonData *data, int
|
||||
|
||||
if (in_scope_resize_zone(but, data->dragstartx, data->dragstarty)) {
|
||||
/* resize vectorscope widget itself */
|
||||
scopes->vecscope_height = BLI_rctf_size_y(&but->rect) + (data->dragstarty - my);
|
||||
scopes->vecscope_height = (BLI_rctf_size_y(&but->rect) + (data->dragstarty - my))/UI_DPI_FAC;
|
||||
}
|
||||
|
||||
data->draglastx = mx;
|
||||
@ -4622,7 +4622,7 @@ static int ui_numedit_but_TRACKPREVIEW(bContext *C, uiBut *but, uiHandleButtonDa
|
||||
|
||||
if (in_scope_resize_zone(but, data->dragstartx, data->dragstarty)) {
|
||||
/* resize preview widget itself */
|
||||
scopes->track_preview_height = BLI_rctf_size_y(&but->rect) + (data->dragstarty - my);
|
||||
scopes->track_preview_height = (BLI_rctf_size_y(&but->rect) + (data->dragstarty - my))/UI_DPI_FAC;
|
||||
}
|
||||
else {
|
||||
if (!scopes->track_locked) {
|
||||
|
@ -1679,7 +1679,7 @@ void uiTemplateHistogram(uiLayout *layout, PointerRNA *ptr, const char *propname
|
||||
|
||||
hist = (Histogram *)cptr.data;
|
||||
|
||||
hist->height = (hist->height <= UI_UNIT_Y) ? UI_UNIT_Y : hist->height;
|
||||
hist->height = (hist->height <= 20) ? 20 : hist->height;
|
||||
|
||||
bt = uiDefBut(block, HISTOGRAM, 0, "", rect.xmin, rect.ymin, BLI_rctf_size_x(&rect), UI_DPI_FAC * hist->height,
|
||||
hist, 0, 0, 0, 0, "");
|
||||
@ -1718,7 +1718,7 @@ void uiTemplateWaveform(uiLayout *layout, PointerRNA *ptr, const char *propname)
|
||||
|
||||
block = uiLayoutAbsoluteBlock(layout);
|
||||
|
||||
scopes->wavefrm_height = (scopes->wavefrm_height <= UI_UNIT_Y) ? UI_UNIT_Y : scopes->wavefrm_height;
|
||||
scopes->wavefrm_height = (scopes->wavefrm_height <= 20) ? 20 : scopes->wavefrm_height;
|
||||
|
||||
bt = uiDefBut(block, WAVEFORM, 0, "", rect.xmin, rect.ymin, BLI_rctf_size_x(&rect), UI_DPI_FAC * scopes->wavefrm_height,
|
||||
scopes, 0, 0, 0, 0, "");
|
||||
@ -1756,7 +1756,7 @@ void uiTemplateVectorscope(uiLayout *layout, PointerRNA *ptr, const char *propna
|
||||
|
||||
block = uiLayoutAbsoluteBlock(layout);
|
||||
|
||||
scopes->vecscope_height = (scopes->vecscope_height <= UI_UNIT_Y) ? UI_UNIT_Y : scopes->vecscope_height;
|
||||
scopes->vecscope_height = (scopes->vecscope_height <= 20) ? 20 : scopes->vecscope_height;
|
||||
|
||||
bt = uiDefBut(block, VECTORSCOPE, 0, "", rect.xmin, rect.ymin, BLI_rctf_size_x(&rect),
|
||||
UI_DPI_FAC * scopes->vecscope_height, scopes, 0, 0, 0, 0, "");
|
||||
|
@ -169,16 +169,16 @@ void uiTemplateTrack(uiLayout *layout, PointerRNA *ptr, const char *propname)
|
||||
scopesptr = RNA_property_pointer_get(ptr, prop);
|
||||
scopes = (MovieClipScopes *)scopesptr.data;
|
||||
|
||||
rect.xmin = 0; rect.xmax = 200;
|
||||
rect.ymin = 0; rect.ymax = 120;
|
||||
rect.xmin = 0; rect.xmax = 10.0f * UI_UNIT_X;
|
||||
rect.ymin = 0; rect.ymax = 6.0f * UI_UNIT_Y;
|
||||
|
||||
block = uiLayoutAbsoluteBlock(layout);
|
||||
|
||||
scopes->track_preview_height =
|
||||
(scopes->track_preview_height <= UI_UNIT_Y) ? UI_UNIT_Y : scopes->track_preview_height;
|
||||
(scopes->track_preview_height <= 20) ? 20 : scopes->track_preview_height;
|
||||
|
||||
uiDefBut(block, TRACKPREVIEW, 0, "", rect.xmin, rect.ymin, BLI_rctf_size_x(&rect),
|
||||
scopes->track_preview_height, scopes, 0, 0, 0, 0, "");
|
||||
scopes->track_preview_height * UI_DPI_FAC, scopes, 0, 0, 0, 0, "");
|
||||
}
|
||||
|
||||
/********************* Marker Template ************************/
|
||||
@ -393,7 +393,7 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
|
||||
else
|
||||
tip = TIP_("Marker is enabled at current frame");
|
||||
|
||||
bt = uiDefIconButBitI(block, TOGN, MARKER_DISABLED, 0, ICON_RESTRICT_VIEW_OFF, 0, 0, 20, 20,
|
||||
bt = uiDefIconButBitI(block, TOGN, MARKER_DISABLED, 0, ICON_RESTRICT_VIEW_OFF, 0, 0, UI_UNIT_X, UI_UNIT_Y,
|
||||
&cb->marker_flag, 0, 0, 1, 0, tip);
|
||||
uiButSetNFunc(bt, marker_update_cb, cb, NULL);
|
||||
}
|
||||
@ -407,7 +407,7 @@ void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, P
|
||||
if (track->flag & TRACK_LOCKED) {
|
||||
uiLayoutSetActive(layout, FALSE);
|
||||
block = uiLayoutAbsoluteBlock(layout);
|
||||
uiDefBut(block, LABEL, 0, IFACE_("Track is locked"), 0, 0, 300, 19, NULL, 0, 0, 0, 0, "");
|
||||
uiDefBut(block, LABEL, 0, IFACE_("Track is locked"), 0, 0, UI_UNIT_X*15.0f, UI_UNIT_Y, NULL, 0, 0, 0, 0, "");
|
||||
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user