diff options
author | Richard Antalik <richardantalik@gmail.com> | 2019-02-23 22:33:48 +0300 |
---|---|---|
committer | Richard Antalik <richardantalik@gmail.com> | 2019-02-23 22:33:48 +0300 |
commit | 82b3b1a3c616abb9c56d1e59366ea2a35fd1b7f6 (patch) | |
tree | e31f39512cf8aecf51e9f2af62bdca5cf2a5bb14 /source | |
parent | 5cc0bfa73a7257f3fa44d6894522aad3d81cdeb2 (diff) |
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 6bcdcc96c2548e0ee5e18acc37915aedee6329e0.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_sequencer.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/sequencer.c | 2 | ||||
-rw-r--r-- | source/blender/editors/interface/view2d.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 14 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_view.c | 24 |
5 files changed, 12 insertions, 31 deletions
diff --git a/source/blender/blenkernel/BKE_sequencer.h b/source/blender/blenkernel/BKE_sequencer.h index 8df2c67ecda..72cdaf97ec3 100644 --- a/source/blender/blenkernel/BKE_sequencer.h +++ b/source/blender/blenkernel/BKE_sequencer.h @@ -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); diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c index cb53e527c11..56e34bbeb11 100644 --- a/source/blender/blenkernel/intern/sequencer.c +++ b/source/blender/blenkernel/intern/sequencer.c @@ -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; diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index bb49f024bc3..6ac8d83da92 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -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); diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index d37eab0e83d..089a30bcf5e 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -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, diff --git a/source/blender/editors/space_sequencer/sequencer_view.c b/source/blender/editors/space_sequencer/sequencer_view.c index 962b02aaeb2..d500a9a081d 100644 --- a/source/blender/editors/space_sequencer/sequencer_view.c +++ b/source/blender/editors/space_sequencer/sequencer_view.c @@ -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; |