Skip to content

Commit

Permalink
Use ?. operation rather than && test, as per review
Browse files Browse the repository at this point in the history
  • Loading branch information
dpvc committed May 24, 2021
1 parent 7a531fe commit 4b7cbdc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions ts/output/common/Wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,14 @@ export class CommonWrapper<
*/
protected copySkewIC(bbox: BBox) {
const first = this.childNodes[0];
if (first) {
first.bbox.sk && (bbox.sk = first.bbox.sk);
first.bbox.dx && (bbox.dx = first.bbox.dx);
if (first?.bbox.sk) {
bbox.sk = first.bbox.sk;
}
if (first?.bbox.dx) {
bbox.dx = first.bbox.dx;
}
const last = this.childNodes[this.childNodes.length - 1];
if (last && last.bbox.ic) {
if (last?.bbox.ic) {
bbox.ic = last.bbox.ic;
bbox.w += bbox.ic;
}
Expand Down

0 comments on commit 4b7cbdc

Please sign in to comment.