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 {
|
return {
|
||||||
color,
|
color,
|
||||||
// $FlowFixMe
|
// $FlowFixMe
|
||||||
stop: lineLength === 0 ? 0 : stop ? stop.getAbsoluteValue(lineLength) / lineLength : null
|
stop:
|
||||||
|
lineLength === 0 ? 0 : stop ? stop.getAbsoluteValue(lineLength) / lineLength : null
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -340,20 +341,23 @@ const findCorner = (bounds: Bounds, x: number, y: number, closest: boolean): Poi
|
|||||||
];
|
];
|
||||||
|
|
||||||
// $FlowFixMe
|
// $FlowFixMe
|
||||||
return corners.reduce((stat, corner) => {
|
return corners.reduce(
|
||||||
const d = distance(x - corner.x, y - corner.y);
|
(stat, corner) => {
|
||||||
if (closest ? d < stat.optimumDistance : d > stat.optimumDistance) {
|
const d = distance(x - corner.x, y - corner.y);
|
||||||
return {
|
if (closest ? d < stat.optimumDistance : d > stat.optimumDistance) {
|
||||||
optimumCorner: corner,
|
return {
|
||||||
optimumDistance: d
|
optimumCorner: corner,
|
||||||
};
|
optimumDistance: d
|
||||||
}
|
};
|
||||||
|
}
|
||||||
|
|
||||||
return stat;
|
return stat;
|
||||||
}, {
|
},
|
||||||
optimumDistance: closest ? Infinity : -Infinity,
|
{
|
||||||
optimumCorner: null
|
optimumDistance: closest ? Infinity : -Infinity,
|
||||||
}).optimumCorner;
|
optimumCorner: null
|
||||||
|
}
|
||||||
|
).optimumCorner;
|
||||||
};
|
};
|
||||||
|
|
||||||
const calculateRadius = (
|
const calculateRadius = (
|
||||||
|
@ -214,8 +214,7 @@ export default class CanvasRenderer implements RenderTarget<HTMLCanvasElement> {
|
|||||||
font.fontWeight,
|
font.fontWeight,
|
||||||
font.fontSize,
|
font.fontSize,
|
||||||
font.fontFamily
|
font.fontFamily
|
||||||
]
|
].join(' ');
|
||||||
.join(' ');
|
|
||||||
|
|
||||||
textBounds.forEach(text => {
|
textBounds.forEach(text => {
|
||||||
this.ctx.fillStyle = color.toString();
|
this.ctx.fillStyle = color.toString();
|
||||||
|
Loading…
Reference in New Issue
Block a user