chiark
/
gitweb
/
~ianmdlvl
/
reprap-play.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1245bcd
)
commitid.scad.pl: refactor gentextmodule_plusq as prep for T (three line)
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Fri, 5 Feb 2016 18:40:14 +0000
(18:40 +0000)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Fri, 5 Feb 2016 18:40:14 +0000
(18:40 +0000)
commitid.scad.pl
patch
|
blob
|
history
diff --git
a/commitid.scad.pl
b/commitid.scad.pl
index c09ce6ab4f635c64a7a0f33b074aee0c525330c0..dc589fe3eb8cd334d8d896c363232973c64a58e2 100755
(executable)
--- a/
commitid.scad.pl
+++ b/
commitid.scad.pl
@@
-269,16
+269,21
@@
sub ljustt ($$$) { # always includes $suffix
return sprintf "%-${sz}.${sz}s%s", $whole, $suffix;
}
return sprintf "%-${sz}.${sz}s%s", $whole, $suffix;
}
+sub gentextmodule_q ($$$) {
+ my ($form, $s, $lines) = @_;
+ $gtm_demo_j++;
+ my $l = length $s;
+ return if $l % $lines;
+ my $e = $l/$lines;
+ return if $e < 2;
+ $gtm_demo_j--;
+ gentextmodule($form, $s =~ m/.{$e}/g);
+}
+
sub gentextmodule_plusq ($$) {
my ($form, $s) = @_;
sub gentextmodule_plusq ($$) {
my ($form, $s) = @_;
- my $l = length $s;
gentextmodule($form, $s);
gentextmodule($form, $s);
- if (!($l & 1) && $l>=4) {
- my $e = $l/2;
- gentextmodule("${form}S", $s =~ m/.{$e}/g);
- } else {
- $gtm_demo_j++;
- }
+ gentextmodule_q("${form}S", $s, 2);
}
our @gcmd;
}
our @gcmd;