mirror of
				https://github.com/Drezil/imgui.git
				synced 2025-11-04 07:01:04 +01:00 
			
		
		
		
	ImFont: fixed minor bug with CPU-side vertical clipping of text.
This commit is contained in:
		@@ -10795,7 +10795,6 @@ void ImFont::RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_re
 | 
			
		||||
                if (!word_wrap_enabled && y + line_height < clip_rect.y)
 | 
			
		||||
                    while (s < text_end && *s != '\n')  // Fast-forward to next line
 | 
			
		||||
                        s++;
 | 
			
		||||
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
            if (c == '\r')
 | 
			
		||||
@@ -10847,6 +10846,11 @@ void ImFont::RenderText(float size, ImVec2 pos, ImU32 col, const ImVec4& clip_re
 | 
			
		||||
                            v2 = v1 + ((clip_rect.w - y1) / (y2 - y1)) * (v2 - v1);
 | 
			
		||||
                            y2 = clip_rect.w;
 | 
			
		||||
                        }
 | 
			
		||||
                        if (y1 >= y2)
 | 
			
		||||
                        {
 | 
			
		||||
                            x += char_width;
 | 
			
		||||
                            continue;
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
 | 
			
		||||
                    // NB: we are not calling PrimRectUV() here because non-inlined causes too much overhead in a debug build.
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user