4
0
mirror of https://github.com/cwinfo/php-barcode.git synced 2025-06-25 22:59:24 +00:00

Tweak default scale and padding for matrix barcodes.

This commit is contained in:
Rebecca G. Bettencourt
2016-06-21 19:01:38 -07:00
parent 68c8582923
commit 26e9a5945c
4 changed files with 50 additions and 42 deletions

View File

@ -148,10 +148,12 @@ class barcode_generator {
(isset($options['w9']) ? (int)$options['w9'] : 1),
);
$size = $this->dispatch_calculate_size($code, $widths, $options);
$scale = (isset($options['sf']) ? (float)$options['sf'] : 1);
$dscale = ($code && isset($code['g']) && $code['g'] == 'm') ? 4 : 1;
$scale = (isset($options['sf']) ? (float)$options['sf'] : $dscale);
$scalex = (isset($options['sx']) ? (float)$options['sx'] : $scale);
$scaley = (isset($options['sy']) ? (float)$options['sy'] : $scale);
$padding = (isset($options['p']) ? (int)$options['p'] : 10);
$dpadding = ($code && isset($code['g']) && $code['g'] == 'm') ? 0 : 10;
$padding = (isset($options['p']) ? (int)$options['p'] : $dpadding);
$vert = (isset($options['pv']) ? (int)$options['pv'] : $padding);
$horiz = (isset($options['ph']) ? (int)$options['ph'] : $padding);
$top = (isset($options['pt']) ? (int)$options['pt'] : $vert);