mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-22 15:16:40 +11:00
fix the overflow bug on kerning / xmin on a new sprite (#725)
- [x] Changelog updated
This commit is contained in:
commit
5ca9cd5480
3 changed files with 9 additions and 5 deletions
|
@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
- Affine background center position didn't work outside of the upper left quadrant of the gba's screen.
|
- Affine background center position didn't work outside of the upper left quadrant of the gba's screen.
|
||||||
- Fixed backtrace pointing to the wrong line of code (being out by one).
|
- Fixed backtrace pointing to the wrong line of code (being out by one).
|
||||||
|
- Fixes overflow caused by certain font characteristics on boundaries of sprites in the object text renderer.
|
||||||
|
|
||||||
## [0.20.2] - 2024/05/25
|
## [0.20.2] - 2024/05/25
|
||||||
|
|
||||||
|
|
|
@ -86,8 +86,12 @@ impl Preprocessor {
|
||||||
);
|
);
|
||||||
self.width_in_sprite = 0;
|
self.width_in_sprite = 0;
|
||||||
}
|
}
|
||||||
if self.width_in_sprite != 0 {
|
self.width_in_sprite += letter.xmin as i32;
|
||||||
self.width_in_sprite += letter.xmin as i32;
|
if self.width_in_sprite < 0 {
|
||||||
|
if let Some(back) = widths.back_mut() {
|
||||||
|
back.0 -= (-self.width_in_sprite).try_into().unwrap_or(0);
|
||||||
|
}
|
||||||
|
self.width_in_sprite = 0;
|
||||||
}
|
}
|
||||||
self.width_in_sprite += letter.advance_width as i32;
|
self.width_in_sprite += letter.advance_width as i32;
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,9 +99,8 @@ impl WordRender {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
if self.working.x_offset != 0 {
|
self.working.x_offset += font_letter.xmin as i32;
|
||||||
self.working.x_offset += font_letter.xmin as i32;
|
self.working.x_offset = self.working.x_offset.max(0);
|
||||||
}
|
|
||||||
|
|
||||||
let y_position = font.ascent() - font_letter.height as i32 - font_letter.ymin as i32;
|
let y_position = font.ascent() - font_letter.height as i32 - font_letter.ymin as i32;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue