Unverified Commit eb9be0cc authored by Jeremy Soller's avatar Jeremy Soller Committed by GitHub

Merge pull request #70 from FloVanGH/combobox

Fix bug when x > 200 the entries of Combobox are not drawn.
parents 9a47320f 301cbd49
......@@ -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()),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment