Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6f92c151 authored by Chris Craik's avatar Chris Craik
Browse files

Factor viewport scaling into coverage calculation

Change-Id: I32114ead0ca42eaf2161d516a4281da216b61fa4
parent 4d3f82e8
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -37,10 +37,10 @@ public class PlaybackGraphs {
    private static Paint whiteLabels;

    private static double viewportCoverage(TileData view, TileData tile) {
        if (tile.left < view.right
                && tile.right >= view.left
                && tile.top < view.bottom
                && tile.bottom >= view.top) {
        if (tile.left < (view.right * view.scale)
                && tile.right >= (view.left * view.scale)
                && tile.top < (view.bottom * view.scale)
                && tile.bottom >= (view.top * view.scale)) {
            return 1.0f;
        }
        return 0.0f;
@@ -215,7 +215,7 @@ public class PlaybackGraphs {
        int lastBar = 0;
        for (int frameIndex = 0; frameIndex < data.frames.length; frameIndex++) {
            TileData frame[] = data.frames[frameIndex];
            int newBar = (frame[0].top + frame[0].bottom) / 2;
            int newBar = (int)((frame[0].top + frame[0].bottom) * frame[0].scale / 2.0f);

            MetricGen s = Metrics[metricIndex];
            double absoluteValue = s.getValue(frame);
+2 −1
Original line number Diff line number Diff line
@@ -46,7 +46,8 @@ public class RunData implements Serializable {

        public String toString() {
            return "Tile (" + left + "," + top + ")->("
                    + right + "," + bottom + ")";
                    + right + "," + bottom + ")"
                    + (isReady ? "ready" : "NOTready") + " at scale " + scale;
        }
    }