Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/image/image_space_image.hh
| Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | public: | ||||
| } | } | ||||
| bool use_tile_drawing() const override | bool use_tile_drawing() const override | ||||
| { | { | ||||
| return (sima->flag & SI_DRAW_TILE) != 0; | return (sima->flag & SI_DRAW_TILE) != 0; | ||||
| } | } | ||||
| void init_ss_to_texture_matrix(const ARegion *region, | void init_ss_to_texture_matrix(const ARegion *region, | ||||
| const float UNUSED(image_resolution[2]), | const float image_display_offset[2], | ||||
| const float image_resolution[2], | |||||
| float r_uv_to_texture[4][4]) const override | float r_uv_to_texture[4][4]) const override | ||||
| { | { | ||||
| float zoom_x = image_resolution[0] * sima->zoom; | |||||
| float zoom_y = image_resolution[1] * sima ->zoom; | |||||
Ethan1080: Inconsistent formatting: `sima ->zoom` `sima->zoom` | |||||
| float image_offset_x = (region->winx - zoom_x) / 2 + sima->xof + image_display_offset[0]; | |||||
| float image_offset_y = (region->winy - zoom_y) / 2 + sima->yof + image_display_offset[1]; | |||||
| unit_m4(r_uv_to_texture); | unit_m4(r_uv_to_texture); | ||||
| float scale_x = 1.0 / BLI_rctf_size_x(®ion->v2d.cur); | float scale_x = 1.0 / BLI_rctf_size_x(®ion->v2d.cur); | ||||
| float scale_y = 1.0 / BLI_rctf_size_y(®ion->v2d.cur); | float scale_y = 1.0 / BLI_rctf_size_y(®ion->v2d.cur); | ||||
| float translate_x = scale_x * -region->v2d.cur.xmin; | float offset_x = 1.0 / image_resolution[0] * image_offset_x; | ||||
| float translate_y = scale_y * -region->v2d.cur.ymin; | float offset_y = 1.0 / image_resolution[1] * image_offset_y; | ||||
| float translate_x = scale_x * (-region->v2d.cur.xmin + offset_x); | |||||
| float translate_y = scale_y * (-region->v2d.cur.ymin + offset_y); | |||||
Ethan1080Unsubmitted Not Done Inline ActionsThe addition of offset_x and offset_y causes issues for the image editor. See: T96543 Ethan1080: The addition of `offset_x` and `offset_y` causes issues for the image editor. See: T96543 | |||||
| r_uv_to_texture[0][0] = scale_x; | r_uv_to_texture[0][0] = scale_x; | ||||
| r_uv_to_texture[1][1] = scale_y; | r_uv_to_texture[1][1] = scale_y; | ||||
| r_uv_to_texture[3][0] = translate_x; | r_uv_to_texture[3][0] = translate_x; | ||||
| r_uv_to_texture[3][1] = translate_y; | r_uv_to_texture[3][1] = translate_y; | ||||
| } | } | ||||
Ethan1080Unsubmitted Not Done Inline ActionsThe block of code above was accidently indented. Ethan1080: The block of code above was accidently indented. | |||||
| }; | }; | ||||
| } // namespace blender::draw::image_engine | } // namespace blender::draw::image_engine | ||||
Inconsistent formatting: sima ->zoom sima->zoom