aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'graphics')
-rw-r--r--graphics/transparent_surface.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/graphics/transparent_surface.h b/graphics/transparent_surface.h
index 461d7a6e4b..8654183548 100644
--- a/graphics/transparent_surface.h
+++ b/graphics/transparent_surface.h
@@ -154,6 +154,13 @@ struct TransparentSurface : public Graphics::Surface {
TransparentSurface *convertTo(const PixelFormat &dstFormat, const byte *palette = 0) const;
+ float getRatio() {
+ if (!w)
+ return 0;
+
+ return h / (float)w;
+ }
+
AlphaType getAlphaMode() const;
void setAlphaMode(AlphaType);
private: