Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasvh committed Dec 12, 2017
1 parent 7bb4a6f commit ab966ff
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 16 deletions.
32 changes: 18 additions & 14 deletions src/Gradient.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ const parseColorStops = (args: Array<string>, firstColorStopIndex: number, lineL
return {
color,
// $FlowFixMe
stop: lineLength === 0 ? 0 : stop ? stop.getAbsoluteValue(lineLength) / lineLength : null
stop:
lineLength === 0 ? 0 : stop ? stop.getAbsoluteValue(lineLength) / lineLength : null
};
});

Expand Down Expand Up @@ -340,20 +341,23 @@ const findCorner = (bounds: Bounds, x: number, y: number, closest: boolean): Poi
];

// $FlowFixMe
return corners.reduce((stat, corner) => {
const d = distance(x - corner.x, y - corner.y);
if (closest ? d < stat.optimumDistance : d > stat.optimumDistance) {
return {
optimumCorner: corner,
optimumDistance: d
};
}
return corners.reduce(
(stat, corner) => {
const d = distance(x - corner.x, y - corner.y);
if (closest ? d < stat.optimumDistance : d > stat.optimumDistance) {
return {
optimumCorner: corner,
optimumDistance: d
};
}

return stat;
}, {
optimumDistance: closest ? Infinity : -Infinity,
optimumCorner: null
}).optimumCorner;
return stat;
},
{
optimumDistance: closest ? Infinity : -Infinity,
optimumCorner: null
}
).optimumCorner;
};

const calculateRadius = (
Expand Down
3 changes: 1 addition & 2 deletions src/renderer/CanvasRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,7 @@ export default class CanvasRenderer implements RenderTarget<HTMLCanvasElement> {
font.fontWeight,
font.fontSize,
font.fontFamily
]
.join(' ');
].join(' ');

textBounds.forEach(text => {
this.ctx.fillStyle = color.toString();
Expand Down

0 comments on commit ab966ff

Please sign in to comment.