Fix bug when x > 200 the entries of Combobox are not drawn.
@@ -86,7 +86,7 @@ impl Widget for Entry {
let mut point = Point::new(rect.x + offset.x, rect.y + rect.height as i32 / 2 - 8);
for c in self.text.get().chars() {
- if point.x + 8 <= rect.width as i32 - 2 * offset.x {
+ if point.x + 8 <= rect.x + rect.width as i32 - offset.x {
renderer.char(point.x, point.y, c, theme.color("color", &selector));
}
point.x += 8;
@@ -326,11 +326,11 @@ impl Widget for ComboBox {
}
// draw selected text
- let mut point = Point::new(rect.x + offset.x - 8, rect.y + rect.height as i32 / 2 - 8);
+ let mut point = Point::new(rect.x + offset.x, rect.y + rect.height as i32 / 2 - 8);
for c in self.text.get().chars() {
- if point.x + 8 <= rect.width as i32 - toggle_rect.width as i32 - 2 * offset.x {
+ if point.x + 8 <= rect.x + rect.width as i32 - toggle_rect.width as i32 - 2 * offset.x {
renderer.char(
- point.x + rect.x,
+ point.x,
point.y,
c,
theme.color("color", &"label".into()),
