1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

gg: add the gg.Context.remove_cached_image_by_idx() method (#13206)

This commit is contained in:
Wertzui123
2022-01-20 07:10:09 +01:00
committed by GitHub
parent ba3308296b
commit d67be6302b
2 changed files with 45 additions and 0 deletions

View File

@ -38,6 +38,10 @@ pub fn (mut ctx Context) get_cached_image_by_idx(image_idx int) &Image {
return &ctx.image_cache[image_idx]
}
pub fn (mut ctx Context) remove_cached_image_by_idx(image_idx int) {
ctx.image_cache.delete(image_idx)
}
// Draw part of an image using uv coordinates
// img_rect is the size and position (in pixels on screen) of the displayed rectangle (ie the draw_image args)
// part_rect is the size and position (in absolute pixels in the image) of the wanted part