Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade Flow to v0.131.0 #11436

Merged
merged 2 commits into from
Jan 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
.*/_site/.*

[version]
0.130.0
0.131.0

[options]
server.max_workers=4
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"eslint-plugin-html": "^6.1.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsdoc": "^32.3.4",
"flow-bin": "0.130.0",
"flow-bin": "0.131.0",
"gl": "^4.9.0",
"glob": "^7.1.6",
"is-builtin-module": "^3.0.0",
Expand Down
11 changes: 6 additions & 5 deletions src/data/bucket/symbol_bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -600,17 +600,18 @@ class SymbolBucket implements Bucket {

addToLineVertexArray(anchor: Anchor, line: any) {
const lineStartIndex = this.lineVertexArray.length;
if (anchor.segment !== undefined) {
let sumForwardLength = anchor.dist(line[anchor.segment + 1]);
let sumBackwardLength = anchor.dist(line[anchor.segment]);
const segment = anchor.segment;
if (segment !== undefined) {
let sumForwardLength = anchor.dist(line[segment + 1]);
let sumBackwardLength = anchor.dist(line[segment]);
const vertices = {};
for (let i = anchor.segment + 1; i < line.length; i++) {
for (let i = segment + 1; i < line.length; i++) {
vertices[i] = {x: line[i].x, y: line[i].y, tileUnitDistanceFromAnchor: sumForwardLength};
if (i < line.length - 1) {
sumForwardLength += line[i + 1].dist(line[i]);
}
}
for (let i = anchor.segment || 0; i >= 0; i--) {
for (let i = segment || 0; i >= 0; i--) {
vertices[i] = {x: line[i].x, y: line[i].y, tileUnitDistanceFromAnchor: sumBackwardLength};
if (i > 0) {
sumBackwardLength += line[i - 1].dist(line[i]);
Expand Down
2 changes: 1 addition & 1 deletion src/data/dem_tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ export default class DemMinMaxQuadTree {
const childMip = mips[childLvl];

let leafMask = 0;
let firstNodeIdx;
let firstNodeIdx = 0;

for (let i = 0; i < this._siblingOffset.length; i++) {
const childX = x * 2 + this._siblingOffset[i][0];
Expand Down
20 changes: 9 additions & 11 deletions src/geo/projection/resample.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,17 @@ function addResampled(resampled, mx0, my0, mx2, my2, start, end, reproject, tole
// reproject and resample a line, adding point where necessary for lines that become curves;
// note that this operation is mutable (modifying original points) for performance
export default function resample(line: Array<Point>, reproject: (Point) => Point, tolerance: number): Array<Point> {
const resampled = [];
let mx0, my0, prev;

for (const point of line) {
let prev = line[0];
let mx0 = prev.x;
let my0 = prev.y;
reproject(prev);
const resampled = [prev];

for (let i = 1; i < line.length; i++) {
const point = line[i];
const {x, y} = point;
reproject(point);

if (prev) {
addResampled(resampled, mx0, my0, x, y, prev, point, reproject, tolerance);
} else {
resampled.push(point);
}

addResampled(resampled, mx0, my0, x, y, prev, point, reproject, tolerance);
mx0 = x;
my0 = y;
prev = point;
Expand Down
6 changes: 3 additions & 3 deletions src/terrain/terrain.js
Original file line number Diff line number Diff line change
Expand Up @@ -1542,13 +1542,13 @@ function createGrid(count: number): [RasterBoundsArray, TriangleIndexArray, numb
* @private
*/
function createWireframeGrid(count: number): LineIndexArray {
let i, j, index;
let index = 0;
const indexArray = new LineIndexArray();
const size = count + 2;
// Draw two edges of a quad and its diagonal. The very last row and column have
// an additional line to close off the grid.
for (j = 1; j < count; j++) {
for (i = 1; i < count; i++) {
for (let j = 1; j < count; j++) {
for (let i = 1; i < count; i++) {
index = j * size + i;
indexArray.emplaceBack(index, index + 1);
indexArray.emplaceBack(index, index + size);
Expand Down
4 changes: 2 additions & 2 deletions src/ui/camera.js
Original file line number Diff line number Diff line change
Expand Up @@ -621,8 +621,8 @@ class Camera extends Evented {

// Calculate zoom: consider the original bbox and padding.
const size = upperRight.sub(lowerLeft);
const scaleX = (tr.width - (edgePadding.left + edgePadding.right + eOptions.padding.left + eOptions.padding.right)) / size.x;
const scaleY = (tr.height - (edgePadding.top + edgePadding.bottom + eOptions.padding.top + eOptions.padding.bottom)) / size.y;
const scaleX = (tr.width - ((edgePadding.left || 0) + (edgePadding.right || 0) + eOptions.padding.left + eOptions.padding.right)) / size.x;
const scaleY = (tr.height - ((edgePadding.top || 0) + (edgePadding.bottom || 0) + eOptions.padding.top + eOptions.padding.bottom)) / size.y;

if (scaleY < 0 || scaleX < 0) {
warnOnce(
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5032,10 +5032,10 @@ flatted@^3.1.0:
resolved "https://registry.npmjs.org/flatted/-/flatted-3.1.1.tgz"
integrity sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==

flow-bin@0.130.0:
version "0.130.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.130.0.tgz#e25eaf891af96da371ff6a9fa99d709f24ce9252"
integrity sha512-1TSLwCPXvKPwiae7Fh+dpipCzwlHQ1UcBHfCpQImz+hsxYIUWkLWJWEm34bY6I7dSM4ekSiVeP02BhzVJGwtpw==
flow-bin@0.131.0:
version "0.131.0"
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.131.0.tgz#d4228b6070afdf3b2a76acdee77a7f3f8e8f5133"
integrity sha512-fZmoIBcDrtLhy/NNMxwJysSYzMr1ksRcAOMi3AHSoYXfcuQqTvhGJx+wqjlIOqIwz8RRYm8J4V4JrSJbIKP+Xg==

flush-write-stream@^1.0.2:
version "1.1.1"
Expand Down