Avoid potential negative array index access to cached text.
[LibreOffice.git] / android / source / src / java / org / mozilla / gecko / gfx / FixedZoomTileLayer.java
blobe86494c20bded01756ceabeb03a78570a8f8b0c5
1 package org.mozilla.gecko.gfx;
3 import android.content.Context;
4 import android.graphics.RectF;
6 public class FixedZoomTileLayer extends ComposedTileLayer {
7 public FixedZoomTileLayer(Context context) {
8 super(context);
11 @Override
12 protected RectF getViewPort(ImmutableViewportMetrics viewportMetrics) {
13 float zoom = getZoom(viewportMetrics);
14 RectF rect = normalizeRect(viewportMetrics.getViewport(), viewportMetrics.zoomFactor, zoom);
15 return inflate(roundToTileSize(rect, tileSize), getInflateFactor());
18 @Override
19 protected float getZoom(ImmutableViewportMetrics viewportMetrics) {
20 return 1.0f / 16.0f;
23 @Override
24 protected int getTilePriority() {
25 return -1;
28 private IntSize getInflateFactor() {
29 return new IntSize(tileSize.width, tileSize.height*6);