Skip to content
Permalink
Browse files

FrameBufferController: remove max aspect ratio check (#1125)

  • Loading branch information...
cpt1gl0 authored and devemux86 committed Jul 3, 2019
1 parent c93cf10 commit ac6076f77f1129c26a4f1ff8eef55e24765b463c
@@ -2,6 +2,7 @@
* Copyright 2010, 2011, 2012, 2013 mapsforge.org
* Copyright 2014 Ludwig M Brinckmann
* Copyright 2015-2017 devemux86
* Copyright 2019 Alexander Schmidt
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
@@ -28,8 +29,6 @@

public final class FrameBufferController implements Observer {

private static float maxAspectRatio = 2;

public static FrameBufferController create(FrameBuffer frameBuffer, Model model) {
FrameBufferController frameBufferController = new FrameBufferController(frameBuffer, model);

@@ -45,11 +44,8 @@ public static Dimension calculateFrameBufferDimension(Dimension mapViewDimension
int width = (int) (mapViewDimension.width * overdrawFactor);
int height = (int) (mapViewDimension.height * overdrawFactor);
if (Parameters.SQUARE_FRAME_BUFFER) {
float aspectRatio = ((float) mapViewDimension.width) / mapViewDimension.height;
if (aspectRatio < maxAspectRatio && aspectRatio > 1 / maxAspectRatio) {
width = Math.max(width, height);
height = width;
}
width = Math.max(width, height);
height = width;
}
return new Dimension(width, height);
}

0 comments on commit ac6076f

Please sign in to comment.
You can’t perform that action at this time.