version 1.20, 2011/10/06 23:22:22
|
version 1.21, 2011/11/30 18:01:33
|
Line 1117 sub size_to_cm {
|
Line 1117 sub size_to_cm {
|
} |
} |
|
|
return $size; # Default is cm. |
return $size; # Default is cm. |
} |
|
|
|
|
|
|
|
#--------------------------------------------------------------------------- |
|
# |
|
# Private methods: |
|
# |
|
|
|
# |
|
# Convert size with units -> size in cm. |
|
# The resulting size is floating point with no units so that it can be used in |
|
# computation. Note that an illegal or missing unit is treated silently as |
|
# cm for now. |
|
# |
|
sub size_to_cm { |
|
my ($this, $size_spec) = @_; |
|
my ($size, $units) = split(/ /, $size_spec); |
|
if (lc($units) eq 'mm') { |
|
return $size / 10.0; |
|
} |
|
if (lc($units) eq 'in') { |
|
return $size * 2.54; |
|
} |
|
|
|
return $size; # Default is cm. |
|
} |
} |
|
|
# |
# |