You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Fix fixed size image fonts incorrectly getting oversampling applied if set to native size.
This commit is contained in:
@@ -3956,7 +3956,8 @@ void TextServerAdvanced::_font_draw_glyph(const RID &p_font_rid, const RID &p_ca
|
||||
}
|
||||
Vector2 gpos = fgl.rect.position;
|
||||
Size2 csize = fgl.rect.size;
|
||||
if (fd->fixed_size > 0 && fd->fixed_size_scale_mode != FIXED_SIZE_SCALE_DISABLE && size.x != p_size * 64) {
|
||||
if (fd->fixed_size > 0 && fd->fixed_size_scale_mode != FIXED_SIZE_SCALE_DISABLE) {
|
||||
if (size.x != p_size * 64) {
|
||||
if (fd->fixed_size_scale_mode == FIXED_SIZE_SCALE_ENABLED) {
|
||||
double gl_scale = (double)p_size / (double)fd->fixed_size;
|
||||
gpos *= gl_scale;
|
||||
@@ -3966,6 +3967,7 @@ void TextServerAdvanced::_font_draw_glyph(const RID &p_font_rid, const RID &p_ca
|
||||
gpos *= gl_scale;
|
||||
csize *= gl_scale;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gpos /= oversampling_factor;
|
||||
csize /= oversampling_factor;
|
||||
@@ -4090,7 +4092,8 @@ void TextServerAdvanced::_font_draw_glyph_outline(const RID &p_font_rid, const R
|
||||
}
|
||||
Vector2 gpos = fgl.rect.position;
|
||||
Size2 csize = fgl.rect.size;
|
||||
if (fd->fixed_size > 0 && fd->fixed_size_scale_mode != FIXED_SIZE_SCALE_DISABLE && size.x != p_size * 64) {
|
||||
if (fd->fixed_size > 0 && fd->fixed_size_scale_mode != FIXED_SIZE_SCALE_DISABLE) {
|
||||
if (size.x != p_size * 64) {
|
||||
if (fd->fixed_size_scale_mode == FIXED_SIZE_SCALE_ENABLED) {
|
||||
double gl_scale = (double)p_size / (double)fd->fixed_size;
|
||||
gpos *= gl_scale;
|
||||
@@ -4100,6 +4103,7 @@ void TextServerAdvanced::_font_draw_glyph_outline(const RID &p_font_rid, const R
|
||||
gpos *= gl_scale;
|
||||
csize *= gl_scale;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gpos /= oversampling_factor;
|
||||
csize /= oversampling_factor;
|
||||
|
||||
@@ -2896,7 +2896,8 @@ void TextServerFallback::_font_draw_glyph(const RID &p_font_rid, const RID &p_ca
|
||||
}
|
||||
Vector2 gpos = fgl.rect.position;
|
||||
Size2 csize = fgl.rect.size;
|
||||
if (fd->fixed_size > 0 && fd->fixed_size_scale_mode != FIXED_SIZE_SCALE_DISABLE && size.x != p_size * 64) {
|
||||
if (fd->fixed_size > 0 && fd->fixed_size_scale_mode != FIXED_SIZE_SCALE_DISABLE) {
|
||||
if (size.x != p_size * 64) {
|
||||
if (fd->fixed_size_scale_mode == FIXED_SIZE_SCALE_ENABLED) {
|
||||
double gl_scale = (double)p_size / (double)fd->fixed_size;
|
||||
gpos *= gl_scale;
|
||||
@@ -2906,6 +2907,7 @@ void TextServerFallback::_font_draw_glyph(const RID &p_font_rid, const RID &p_ca
|
||||
gpos *= gl_scale;
|
||||
csize *= gl_scale;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gpos /= oversampling_factor;
|
||||
csize /= oversampling_factor;
|
||||
@@ -3030,7 +3032,8 @@ void TextServerFallback::_font_draw_glyph_outline(const RID &p_font_rid, const R
|
||||
}
|
||||
Vector2 gpos = fgl.rect.position;
|
||||
Size2 csize = fgl.rect.size;
|
||||
if (fd->fixed_size > 0 && fd->fixed_size_scale_mode != FIXED_SIZE_SCALE_DISABLE && size.x != p_size * 64) {
|
||||
if (fd->fixed_size > 0 && fd->fixed_size_scale_mode != FIXED_SIZE_SCALE_DISABLE) {
|
||||
if (size.x != p_size * 64) {
|
||||
if (fd->fixed_size_scale_mode == FIXED_SIZE_SCALE_ENABLED) {
|
||||
double gl_scale = (double)p_size / (double)fd->fixed_size;
|
||||
gpos *= gl_scale;
|
||||
@@ -3040,6 +3043,7 @@ void TextServerFallback::_font_draw_glyph_outline(const RID &p_font_rid, const R
|
||||
gpos *= gl_scale;
|
||||
csize *= gl_scale;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gpos /= oversampling_factor;
|
||||
csize /= oversampling_factor;
|
||||
|
||||
Reference in New Issue
Block a user