Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to change quiet_zone size #49

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/render/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ impl<'a, P: Pixel> Renderer<'a, P> {
self
}

/// Sets the size of the quiet zone in the generated image.
///
/// Default: 4 for Normal QR code and 2 for Micro QR code
pub fn quiet_zone_size(&mut self, quiet_zone: u32) -> &mut Self {
self.quiet_zone = quiet_zone;
self
}

/// Whether to include the quiet zone in the generated image.
pub fn quiet_zone(&mut self, has_quiet_zone: bool) -> &mut Self {
self.has_quiet_zone = has_quiet_zone;
Expand Down