Skip to content

Commit ee36d5f

Browse files
committed
WIP - Fonts: fixed GetCustomRectUV().
Broken by fe598f7
1 parent 0a11bb7 commit ee36d5f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

imgui_draw.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -2503,7 +2503,7 @@ void ImTextureData::DestroyPixels()
25032503
// - ImFontAtlas::AddCustomRectRegular()
25042504
// - ImFontAtlas::AddCustomRectFontGlyph()
25052505
// - ImFontAtlas::GetCustomRect()
2506-
// - ImFontAtlas::CalcCustomRectUV()
2506+
// - ImFontAtlas::GetCustomRectUV()
25072507
// - ImFontAtlasGetMouseCursorTexData()
25082508
//-----------------------------------------------------------------------------
25092509
// - ImFontAtlasBuildMain()
@@ -3302,7 +3302,7 @@ void ImFontAtlas::GetCustomRectUV(const ImTextureRect* rect, ImVec2* out_uv_min,
33023302
{
33033303
IM_ASSERT(TexData->Width > 0 && TexData->Height > 0); // Font atlas needs to be built before we can calculate UV coordinates
33043304
*out_uv_min = ImVec2((float)rect->x * TexUvScale.x, (float)rect->y * TexUvScale.y);
3305-
*out_uv_max = ImVec2((float)(rect->x + rect->w) * TexUvScale.x, (float)(rect->y + rect->w) * TexUvScale.y);
3305+
*out_uv_max = ImVec2((float)(rect->x + rect->w) * TexUvScale.x, (float)(rect->y + rect->h) * TexUvScale.y);
33063306
}
33073307

33083308
bool ImFontAtlasGetMouseCursorTexData(ImFontAtlas* atlas, ImGuiMouseCursor cursor_type, ImVec2* out_offset, ImVec2* out_size, ImVec2 out_uv_border[2], ImVec2 out_uv_fill[2])

0 commit comments

Comments
 (0)