Revert "Glyph cache is cleared by UI_view2d_zoom_cache_reset, when zooming V2D, but is required to calculate text height in UI_view2d_text_cache_draw"
Accidentaly committed unwanted changes.
This reverts commit 6bcdcc96c2
.
This commit is contained in:
parent
5cc0bfa73a
commit
82b3b1a3c6
|
@ -240,7 +240,6 @@ int BKE_sequencer_evaluate_frame(struct Scene *scene, int cfra);
|
|||
struct StripElem *BKE_sequencer_give_stripelem(struct Sequence *seq, int cfra);
|
||||
|
||||
/* intern */
|
||||
double seq_rendersize_to_scale_factor(int size);
|
||||
void BKE_sequencer_update_changed_seq_and_deps(struct Scene *scene, struct Sequence *changed_seq, int len_change, int ibuf_change);
|
||||
bool BKE_sequencer_input_have_to_preprocess(const SeqRenderData *context, struct Sequence *seq, float cfra);
|
||||
|
||||
|
|
|
@ -1471,7 +1471,7 @@ static IMB_Proxy_Size seq_rendersize_to_proxysize(int size)
|
|||
return IMB_PROXY_25;
|
||||
}
|
||||
|
||||
double seq_rendersize_to_scale_factor(int size)
|
||||
static double seq_rendersize_to_scale_factor(int size)
|
||||
{
|
||||
if (size >= 99) {
|
||||
return 1.0;
|
||||
|
|
|
@ -2572,8 +2572,6 @@ void UI_view2d_text_cache_draw(ARegion *ar)
|
|||
|
||||
/* investigate using BLF_ascender() */
|
||||
const int font_id = BLF_default();
|
||||
|
||||
BLF_set_default();
|
||||
const float default_height = g_v2d_strings ? BLF_height(font_id, "28", 3) : 0.0f;
|
||||
|
||||
wmOrtho2_region_pixelspace(ar);
|
||||
|
|
|
@ -897,26 +897,24 @@ ImBuf *sequencer_ibuf_get(
|
|||
SeqRenderData context = {0};
|
||||
ImBuf *ibuf;
|
||||
int rectx, recty;
|
||||
short is_break = G.is_break;
|
||||
short render_size = sseq->render_size;
|
||||
float render_size;
|
||||
float proxy_size = 100.0;
|
||||
double scale_fac;
|
||||
short is_break = G.is_break;
|
||||
|
||||
render_size = sseq->render_size;
|
||||
if (render_size == 0) {
|
||||
render_size = scene->r.size;
|
||||
scale_fac = (float)scene->r.size / 100.0f;
|
||||
}
|
||||
else {
|
||||
scale_fac = seq_rendersize_to_scale_factor(render_size);
|
||||
proxy_size = scale_fac * 100;
|
||||
proxy_size = render_size;
|
||||
}
|
||||
|
||||
if (render_size < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rectx = ((float) scene->r.xsch * scale_fac) + 0.5f;
|
||||
recty = ((float) scene->r.ysch * scale_fac) + 0.5f;
|
||||
rectx = (render_size * (float)scene->r.xsch) / 100.0f + 0.5f;
|
||||
recty = (render_size * (float)scene->r.ysch) / 100.0f + 0.5f;
|
||||
|
||||
BKE_sequencer_new_render_data(
|
||||
bmain, depsgraph, scene,
|
||||
|
|
|
@ -90,6 +90,7 @@ static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
ARegion *ar = CTX_wm_region(C);
|
||||
ImBuf *ibuf = sequencer_ibuf_get(bmain, depsgraph, scene, sseq, CFRA, 0, NULL);
|
||||
ImageSampleInfo *info = op->customdata;
|
||||
float fx, fy;
|
||||
|
||||
if (ibuf == NULL) {
|
||||
IMB_freeImBuf(ibuf);
|
||||
|
@ -97,33 +98,18 @@ static void sample_apply(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
return;
|
||||
}
|
||||
|
||||
short scene_scale_size = sseq->render_size ? 100 : scene->r.size;
|
||||
float rectx = (float) scene->r.xsch * ((float) scene_scale_size / 100.0f);
|
||||
float recty = (float) scene->r.ysch * ((float) scene_scale_size / 100.0f);
|
||||
float scale_x = (float) ibuf->x / rectx;
|
||||
float scale_y = (float) ibuf->y / recty;
|
||||
float fx, fy;
|
||||
|
||||
/* max coords are +/- (rect* / 2)
|
||||
*/
|
||||
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &fx, &fy);
|
||||
|
||||
fx += rectx / 2.0f;
|
||||
fy += recty / 2.0f;
|
||||
|
||||
/* to get ibuf coords we have to scale by (ibuf->* / rect*)
|
||||
*/
|
||||
fx *= scale_x;
|
||||
fy *= scale_y;
|
||||
fx += (float) ibuf->x / 2.0f;
|
||||
fy += (float) ibuf->y / 2.0f;
|
||||
|
||||
if (fx >= 0.0f && fy >= 0.0f && fx < ibuf->x && fy < ibuf->y) {
|
||||
const float *fp;
|
||||
unsigned char *cp;
|
||||
int x = (int) fx, y = (int) fy;
|
||||
|
||||
/* we will report mouse position on unscaled image */
|
||||
info->x = 1 + x / scale_x;
|
||||
info->y = 1 + y / scale_y;
|
||||
info->x = x;
|
||||
info->y = y;
|
||||
info->draw = 1;
|
||||
info->channels = ibuf->channels;
|
||||
|
||||
|
|
Loading…
Reference in New Issue