mirror of
https://github.com/niklasvh/html2canvas.git
synced 2023-08-10 21:13:10 +03:00
Fix formatting
This commit is contained in:
parent
7bb4a6f08f
commit
ab966ff311
@ -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 = (
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user