Skip to content

Commit

Permalink
merge(#52): from aruZeta/release/3.1.0
Browse files Browse the repository at this point in the history
Release: 3.1.0
  • Loading branch information
aruZeta authored Jan 29, 2024
2 parents 48231c7 + 08c20b4 commit 4445bb9
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/benchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
- name: Fetch repo's pushed branch
uses: actions/checkout@v3
- name: Install nix
uses: cachix/install-nix-action@v16
uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-22.05
- name: Setup cachix
uses: cachix/cachix-action@v10
uses: cachix/cachix-action@v12
with:
name: my-dotfiles # Holds the cached flake, so not to build it
- name: Run benchmarks
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gendocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ jobs:
ref: docs
path: destination
- name: Install nix
uses: cachix/install-nix-action@v16
uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-22.05
- name: Setup cachix
uses: cachix/cachix-action@v10
uses: cachix/cachix-action@v12
with:
name: my-dotfiles # Holds the cached flake, so not to build it
- name: Build docs
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ jobs:
- name: Fetch repo's pushed branch
uses: actions/checkout@v3
- name: Install nix
uses: cachix/install-nix-action@v16
uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-22.05
- name: Setup cachix
uses: cachix/cachix-action@v10
uses: cachix/cachix-action@v12
with:
name: my-dotfiles # Holds the cached flake, so not to build it
- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion QRgen.nimble
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Package

version = "3.0.0"
version = "3.1.0"
author = "aruZeta"
description = "A QR code generation library."
license = "MIT"
Expand Down
9 changes: 5 additions & 4 deletions src/QRgen/renderer.nim
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ proc renderImg*(
moSep: Percentage = 0,
pixels: uint32 = 512,
img: Image = Image(width: 0, height: 0),
imgCoords: tuple[x, y, w, h: uint8] = self.genDefaultCoords
imgCoords: tuple[x, y, w, h: uint8] = self.genDefaultCoords,
padding: uint8 = 5
): Image =
## Print a `DrawedQRCode` in PNG format (returned as a `Image` from pixie).
##
Expand Down Expand Up @@ -78,10 +79,10 @@ proc renderImg*(
## will be. You can change this by setting `imgCoords`, which contains a
## tuple with the `x,y` position of `img` and it's width an height.
let
modules: uint8 = self.drawing.size + 10
modules: uint8 = self.drawing.size + padding * 2
modulePixels: uint16 = (pixels div modules).uint16
pixelsMargin: uint16 = (pixels mod modules).uint16 div 2 + modulePixels*5
actualSize: uint32 = modulePixels.uint32*(modules-10) + (pixelsMargin+1)*2
pixelsMargin: uint16 = (pixels mod modules).uint16 div 2 + modulePixels * padding
actualSize: uint32 = modulePixels.uint32*(modules-(padding * 2)) + (pixelsMargin+1)*2
let pixels: uint32 =
if actualSize < pixels: actualSize
else: pixels
Expand Down

0 comments on commit 4445bb9

Please sign in to comment.