Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in display.height. #97

Merged
merged 1 commit into from
Mar 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/pixel-display-impl_.toit
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ abstract class PixelDisplay implements Window:
elements_ := {}
background_ := null
width: return driver_.width
height: return driver_.width
height: return driver_.height
/// Deprecated.
inner-width: return driver_.width
inner-height: return driver_.width
/// Deprecated.
inner-height: return driver_.height

/**
By default, the display is rendered in patches that have
Expand Down
2 changes: 2 additions & 0 deletions tests/bitmap-visualized.toit
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ main args:
do basename/string w/int h/int:
driver := TrueColorPngVisualizer w h basename --outline=0xc0c0ff
display := PixelDisplay.true-color driver
expect-equals w display.width
expect-equals h display.height
display.background = 0x808080

// A 1-bit PNG file that is uncompressed, so we can use the PngRandomAccess
Expand Down