UV and ST

This commit is contained in:
2022-12-30 19:31:06 +00:00
parent daebe5c665
commit eadf3524ba
6 changed files with 62 additions and 61 deletions

View File

@@ -869,12 +869,12 @@ void editor_asset_tex_gui(struct Texture *tex) {
if (old_frames != tex->anim.frames || old_ms != tex->anim.ms)
tex_anim_set(&tex_gui_anim);
nk_layout_row_static(ctx, tex->height*tex_scale*tex_gui_anim.uv.h, tex->width*tex_scale*tex_gui_anim.uv.w, 1);
nk_layout_row_static(ctx, tex->height*tex_scale*(tex_gui_anim.st.t1-tex_gui_anim.st.t0), tex->width*tex_scale*(tex_gui_anim.st.s1 - tex_gui_anim.st.s0), 1);
struct nk_rect r;
r.x = tex_gui_anim.uv.x*tex->width;
r.y = tex_gui_anim.uv.y*tex->height;
r.w = tex_gui_anim.uv.w*tex->width;
r.h = tex_gui_anim.uv.h*tex->height;
r.x = tex_gui_anim.st.s0*tex->width;
r.y = tex_gui_anim.st.t0*tex->height;
r.w = st_s_w(tex_gui_anim.st)*tex->width;
r.h = st_s_h(tex_gui_anim.st)*tex->height;
nk_image(ctx, nk_subimage_id(tex->id, tex->width, tex->height, r));
} else {