diff options
Diffstat (limited to 'source/blender/editors/space_image/image_draw.c')
-rw-r--r-- | source/blender/editors/space_image/image_draw.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index fc04ec1fe02..8858df3323f 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -112,13 +112,6 @@ static void draw_render_info( GPU_matrix_translate_2f(x, y); GPU_matrix_scale_2f(zoomx, zoomy); - RenderData *rd = RE_engine_get_render_data(re); - if (rd->mode & R_BORDER) { - /* TODO: round or floor instead of casting to int */ - GPU_matrix_translate_2f((int)(-rd->border.xmin * rd->xsch * rd->size * 0.01f), - (int)(-rd->border.ymin * rd->ysch * rd->size * 0.01f)); - } - uint pos = GPU_vertformat_attr_add( immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); @@ -142,7 +135,6 @@ static void draw_render_info( } } -/* used by node view too */ void ED_image_draw_info(Scene *scene, ARegion *region, bool color_manage, @@ -192,7 +184,7 @@ void ED_image_draw_info(Scene *scene, GPU_blend(GPU_BLEND_NONE); - BLF_size(blf_mono_font, 11 * U.pixelsize, U.dpi); + BLF_size(blf_mono_font, 11.0f * U.pixelsize, U.dpi); BLF_color3ub(blf_mono_font, 255, 255, 255); SNPRINTF(str, "X:%-4d Y:%-4d |", x, y); @@ -507,7 +499,7 @@ void draw_image_main_helpers(const bContext *C, ARegion *region) } } -bool ED_space_image_show_cache(SpaceImage *sima) +bool ED_space_image_show_cache(const SpaceImage *sima) { Image *image = ED_space_image(sima); Mask *mask = NULL; @@ -523,6 +515,17 @@ bool ED_space_image_show_cache(SpaceImage *sima) return true; } +bool ED_space_image_show_cache_and_mval_over(const SpaceImage *sima, + ARegion *region, + const int mval[2]) +{ + const rcti *rect_visible = ED_region_visible_rect(region); + if (mval[1] > rect_visible->ymin + (16 * UI_DPI_FAC)) { + return false; + } + return ED_space_image_show_cache(sima); +} + void draw_image_cache(const bContext *C, ARegion *region) { SpaceImage *sima = CTX_wm_space_image(C); @@ -588,7 +591,7 @@ float ED_space_image_zoom_level(const View2D *v2d, const int grid_dimension) * - Default grid size on startup, which is 256x256 pixels * - How blend factor for grid lines is set up in the fragment shader `grid_frag.glsl`. */ float zoom_factor; - zoom_factor = (xzoom + yzoom) / 2.0f; /* Average for accuracy. */ + zoom_factor = (xzoom + yzoom) / 2.0f; /* Average for accuracy. */ zoom_factor *= 256.0f / (powf(grid_dimension, 2)); return zoom_factor; } @@ -610,11 +613,6 @@ void ED_space_image_grid_steps(SpaceImage *sima, } } -/** - * Calculate the increment snapping value for UV/image editor based on the zoom factor - * The code in here (except the offset part) is used in `grid_frag.glsl` (see `grid_res`) for - * drawing the grid overlay for the UV/Image editor. - */ float ED_space_image_increment_snap_value(const int grid_dimesnions, const float grid_steps[SI_GRID_STEPS_LEN], const float zoom_factor) |