Skip to content

Commit 907b74f

Browse files
committed
atg-agg demo draw text in same pos in retina
1 parent 37d2be8 commit 907b74f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

demos/atb-agg.c

+8-1
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,13 @@ build_buffer( void )
157157
if (!font)
158158
return;
159159

160+
int pixHeight;
161+
{
162+
int viewport[4];
163+
glGetIntegerv( GL_VIEWPORT, viewport );
164+
pixHeight = viewport[3];
165+
}
166+
160167
markup.font = font;
161168
font->hinting = p_hinting;
162169
font->kerning = p_kerning;
@@ -168,7 +175,7 @@ build_buffer( void )
168175
font->lcd_weights[3] = (unsigned char)(p_secondary*norm*256);
169176
font->lcd_weights[4] = (unsigned char)(p_tertiary*norm*256);
170177
pen.x = 10;
171-
pen.y = 600 - font->height - 10;
178+
pen.y = pixHeight - font->height - 10;
172179
text_buffer_printf( text_buffer, &pen, &markup, text, NULL );
173180

174181
// Post-processing for width and orientation

0 commit comments

Comments
 (0)