Fix formatting

This commit is contained in:
Niklas von Hertzen 2017-12-12 22:23:48 +08:00
parent 7bb4a6f08f
commit ab966ff311
2 changed files with 19 additions and 16 deletions

View File

@ -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
};
});
@ -340,7 +341,8 @@ const findCorner = (bounds: Bounds, x: number, y: number, closest: boolean): Poi
];
// $FlowFixMe
return corners.reduce((stat, corner) => {
return corners.reduce(
(stat, corner) => {
const d = distance(x - corner.x, y - corner.y);
if (closest ? d < stat.optimumDistance : d > stat.optimumDistance) {
return {
@ -350,10 +352,12 @@ const findCorner = (bounds: Bounds, x: number, y: number, closest: boolean): Poi
}
return stat;
}, {
},
{
optimumDistance: closest ? Infinity : -Infinity,
optimumCorner: null
}).optimumCorner;
}
).optimumCorner;
};
const calculateRadius = (

View File

@ -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();