summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2019-05-09 19:54:18 -0700
committerVito Caputo <vcaputo@pengaru.com>2019-05-10 14:18:28 -0700
commitd8c275e702da7ab51418e22fc9e36701c71e1483 (patch)
tree8c0dbffbd677c4d2ad7561c391fd4c5172ec38bd
parent0836af39624f5bcf0361d26782695bf0e967f52b (diff)
libstage: remove vestigial stage_fit()
This hasn't belonged in libstage since losing all dimensionality
-rw-r--r--src/stage.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/src/stage.c b/src/stage.c
index a9a5829..d05c842 100644
--- a/src/stage.c
+++ b/src/stage.c
@@ -225,28 +225,6 @@ void stage_clear(stage_t *stage)
}
-/* fit a stage to the supplied dimensions, returns the fitted dimensions in the result pointers */
-/* the idea is this can be used in a window resize hook to enforce the stage's aspect ratio */
-void stage_fit(float aspect_ratio, int width, int height, int *res_width, int *res_height)
-{
- float full_width = aspect_ratio * ((float)height);
-
- if (full_width == width) {
- /* perfect fit */
- *res_width = width;
- *res_height = height;
- } else if (full_width > width) {
- /* height is too large */
- *res_height = (1.0f / aspect_ratio) * ((float)width);
- *res_width = width;
- } else {
- /* width is too large */
- *res_width = full_width;
- *res_height = height;
- }
-}
-
-
static void _render_stage(const stage_t *stage, float alpha)
{
float a = alpha * stage->alpha;
© All Rights Reserved