| 2283 | } |
| 2284 | |
| 2285 | bool ImFontAtlas::GetMouseCursorTexData(ImGuiMouseCursor cursor_type, ImVec2* out_offset, ImVec2* out_size, ImVec2 out_uv_border[2], ImVec2 out_uv_fill[2]) |
| 2286 | { |
| 2287 | if (cursor_type <= ImGuiMouseCursor_None || cursor_type >= ImGuiMouseCursor_COUNT) |
| 2288 | return false; |
| 2289 | if (Flags & ImFontAtlasFlags_NoMouseCursors) |
| 2290 | return false; |
| 2291 | |
| 2292 | IM_ASSERT(PackIdMouseCursors != -1); |
| 2293 | ImFontAtlasCustomRect* r = GetCustomRectByIndex(PackIdMouseCursors); |
| 2294 | ImVec2 pos = FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[cursor_type][0] + ImVec2((float)r->X, (float)r->Y); |
| 2295 | ImVec2 size = FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[cursor_type][1]; |
| 2296 | *out_size = size; |
| 2297 | *out_offset = FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[cursor_type][2]; |
| 2298 | out_uv_border[0] = (pos)*TexUvScale; |
| 2299 | out_uv_border[1] = (pos + size) * TexUvScale; |
| 2300 | pos.x += FONT_ATLAS_DEFAULT_TEX_DATA_W + 1; |
| 2301 | out_uv_fill[0] = (pos)*TexUvScale; |
| 2302 | out_uv_fill[1] = (pos + size) * TexUvScale; |
| 2303 | return true; |
| 2304 | } |
| 2305 | |
| 2306 | bool ImFontAtlas::Build() |
| 2307 | { |
no test coverage detected