-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add primitive use-image
to use image by natural size
#297
base: master
Are you sure you want to change the base?
Conversation
Just my two cents. Why not add a primitive that gets the soze (e.g., |
Thank you for the development! It also looks more preferable to me to provide |
Thanks for replaying. From my standings, I want to replace Using let get-image-size img =
let ib = use-image img in
let (w, h, d) = get-natural-metrics ib in
(w, h)
let use-image-by-width img wid =
let ib = use-image img in
let (w, h, d) = get-natural-metrics ib in
let hgt = h *' (wid /' w) in
inline-graphics wid hgt 0pt (fun (x, y) -> (
let g = draw-text (x, y) ib in
linear-transform-graphics g
)) |
To be short: 違う例としては
があるわけですが、これにおける (ただこれはあくまで1意見であり、 |
use-image
to use image by natural size
I updated the implementation to come up with the following ideas:
Key point is: Is there any comments on this idea? |
以下のアイデアを実現するために実装を更新しました。
キーポイントは |
Add the primitives:
This is implementation of #296