nitlanguage
/
nit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
626c12f
)
lib/gamnit: intro `GamnitDisplay::aspect_ratio`
author
Alexis Laferrière
<alexis.laf@xymus.net>
Tue, 29 Sep 2015 20:49:40 +0000
(16:49 -0400)
committer
Alexis Laferrière
<alexis.laf@xymus.net>
Thu, 10 Dec 2015 20:32:47 +0000
(15:32 -0500)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>
lib/gamnit/display.nit
patch
|
blob
|
history
diff --git
a/lib/gamnit/display.nit
b/lib/gamnit/display.nit
index
94ece8a
..
97d82b5
100644
(file)
--- a/
lib/gamnit/display.nit
+++ b/
lib/gamnit/display.nit
@@
-32,6
+32,9
@@
class GamnitDisplay
# Height of the display, in pixels
fun height: Int is abstract
+ # Aspect ratio of the screen, `width / height`
+ var aspect_ratio: Float is lazy do return width.to_f / height.to_f
+
# Prepare this display
#
# The implementation varies per platform.