diff --git a/lib/umka b/lib/umka index fcf7a67..e055fcd 160000 --- a/lib/umka +++ b/lib/umka @@ -1 +1 @@ -Subproject commit fcf7a67da4d1d20dcf9dca14979a4c1845f6ac06 +Subproject commit e055fcda66f0fb2abdcc9bb022873b99aceddf17 diff --git a/src/staembed.c b/src/staembed.c index c8473c8..aac19b4 100644 --- a/src/staembed.c +++ b/src/staembed.c @@ -691,7 +691,8 @@ const char *th_em_modulesrc[] = { "\t\tth::__error(\"image is invalid\")\n" "\t}\n" "\n" -"\tumth_image_crop(i^, r.getPos(), r.getEnd())\n" +"\tdm := i.getDims()\n" +"\tumth_image_crop(i^, r.getPos().div(dm), r.getEnd().div(dm))\n" "}\n" "\n" "fn umth_image_crop_quad(img: Image, q: ^th::Quad)\n" diff --git a/umka/image.um b/umka/image.um index 1a98d84..b055474 100644 --- a/umka/image.um +++ b/umka/image.um @@ -192,7 +192,8 @@ fn (i: ^Image) cropRect*(r: rect::Rect) { th::__error("image is invalid") } - umth_image_crop(i^, r.getPos(), r.getEnd()) + dm := i.getDims() + umth_image_crop(i^, r.getPos().div(dm), r.getEnd().div(dm)) } fn umth_image_crop_quad(img: Image, q: ^th::Quad)