mdraw_coor...s_position(3m17n)
π¦ mdraw_coordinates_position β the 3m17n glow-up β¨
okay bestie, we're in the m17n library manual, and this page is short but it's giving very specific energy. let's get into it π
πΈ NAME πΈ
mdraw_coordinates_position β (yes the description is literally empty in the original, iconic of her tbh π)
β¨ SYNOPSIS β¨
int mdraw_coordinates_position (MFrame * frame, MText * mt, int from,
int to, int x_offset, int y_offset, MDrawControl * control)
π DESCRIPTION π
so what she does is: she returns the character position nearest to the coordinates. periodt.
the mdraw_coordinates_position() function checks which character is to be drawn at coordinate (x, y) when the text between from and to of M-text mt is drawn at the coordinate (0, 0) using the mdraw_text_with_control() function with the drawing control object control. π
and like, "character position" here means the number of characters that precede the character in question in mt β that is, the character position of the first character is 0. so it's zero-indexed, no cap π«Ά
frame is used only to get the default face information. that's it. that's her whole job in this function. slay, lowkey π¦
π RETURN VALUE π
okay so this is where it gets β¨specificβ¨, so listen up:
- If the glyph image of a character covers coordinate
(x, y),mdraw_coordinates_position()returns the character position of that character. π« - If
yis less than the minimum Y-coordinate of the drawn area, it returnsfrom. - If
yis greater than the maximum Y-coordinate of the drawn area, it returnsto. - If
yfits in with the drawn area butxis less than the minimum X-coordinate, it returns the character position of the first character drawn on the liney. - If
yfits in with the drawn area butxis greater than the maximum X-coordinate, it returns the character position of the last character drawn on the liney.
ngl bestie, the "did it land on a glyph or did it fall off the edge of the world" logic is doing a LOT of heavy lifting here. know your boundaries, know yourself π
π COPYRIGHT π
Copyright (C) 2001 Information-technology Promotion Agency (IPA)
Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License <http://www.gnu.org/licenses/fdl.html>.
and that's the whole page, bestie!! π₯³ this is Version 1.8.4, dated Mon Sep 25 2023, from the m17n manual β so if you're reading this, you're basically holding a little time capsule from 2023. go forth and position those coordinates, main character π
πΈβ¨
π¦ where this page comes from
- debian trixie: m17n-docs 1.8.4-1
- ubuntu noble: m17n-docs 1.8.4-1
- ubuntu questing: m17n-docs 1.8.4-1
- ubuntu resolute: m17n-docs 1.8.4-1build1
- ubuntu stonking: m17n-docs 1.8.4-1build1
- Copyright (C) 2001 Information-technology Promotion Agency (IPA)
- Copyright (C) 2001-2011 National Institute of Advanced Industrial Science and Technology (AIST)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms