Skip to content

Commit

Permalink
set default margin for bitmap to 1 as well
Browse files Browse the repository at this point in the history
  • Loading branch information
gugu committed Nov 11, 2022
1 parent ae2f1fa commit df6f35b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { ImageOptions, ImageType } from "./typing/types";

export function getOptions(inOptions: ImageOptions) {
const type: ImageType =
!inOptions || !inOptions.type ? "png" : inOptions.type;
const type: ImageType = inOptions?.type ?? "png";
const defaults = type === "png" ? BITMAP_OPTIONS : VECTOR_OPTIONS;
return { ...defaults, ...inOptions };
}
Expand Down Expand Up @@ -30,7 +29,7 @@ const commonOptions: Pick<

const BITMAP_OPTIONS: ImageOptions = {
...commonOptions,
margin: 4,
margin: 1,
size: 5,
};

Expand Down

0 comments on commit df6f35b

Please sign in to comment.