Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Amanda Ghassaei
OrigamiSimulator
Commits
80e35bc4
Commit
80e35bc4
authored
Jul 18, 2017
by
amandaghassaei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove whitespace from stroke
parent
df5eace9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
7 deletions
+10
-7
js/pattern.js
js/pattern.js
+10
-7
No files found.
js/pattern.js
View file @
80e35bc4
...
...
@@ -124,20 +124,23 @@ function initPattern(globals){
var
stroke
=
obj
.
attr
(
"
stroke
"
);
if
(
stroke
===
undefined
)
{
if
(
obj
.
attr
(
"
style
"
)
&&
$
(
obj
)[
0
].
style
.
stroke
)
{
return
(
$
(
obj
)[
0
].
style
.
stroke
).
toLowerCase
();
stroke
=
(
$
(
obj
)[
0
].
style
.
stroke
).
toLowerCase
();
stroke
=
stroke
.
replace
(
/
\s
/g
,
''
);
//remove all whitespace
return
stroke
;
}
return
null
;
}
stroke
=
stroke
.
replace
(
/
\s
/g
,
''
);
//remove all whitespace
return
stroke
.
toLowerCase
();
}
function
typeForStroke
(
stroke
){
if
(
stroke
==
"
#000000
"
||
stroke
==
"
#000
"
||
stroke
==
"
black
"
||
stroke
==
"
rgb(0,
0,
0)
"
)
return
"
border
"
;
if
(
stroke
==
"
#ff0000
"
||
stroke
==
"
#f00
"
||
stroke
==
"
red
"
||
stroke
==
"
rgb(255,
0,
0)
"
)
return
"
mountain
"
;
if
(
stroke
==
"
#0000ff
"
||
stroke
==
"
#00f
"
||
stroke
==
"
blue
"
||
stroke
==
"
rgb(0,
0,
255)
"
)
return
"
valley
"
;
if
(
stroke
==
"
#00ff00
"
||
stroke
==
"
#0f0
"
||
stroke
==
"
green
"
||
stroke
==
"
rgb(0,
255,
0)
"
)
return
"
cut
"
;
if
(
stroke
==
"
#ffff00
"
||
stroke
==
"
#ff0
"
||
stroke
==
"
yellow
"
||
stroke
==
"
rgb(255,
255,
0)
"
)
return
"
triangulation
"
;
if
(
stroke
==
"
#ff00ff
"
||
stroke
==
"
#f0f
"
||
stroke
==
"
magenta
"
||
stroke
==
"
rgb(255,
0,
255)
"
)
return
"
hinge
"
;
if
(
stroke
==
"
#000000
"
||
stroke
==
"
#000
"
||
stroke
==
"
black
"
||
stroke
==
"
rgb(0,0,0)
"
)
return
"
border
"
;
if
(
stroke
==
"
#ff0000
"
||
stroke
==
"
#f00
"
||
stroke
==
"
red
"
||
stroke
==
"
rgb(255,0,0)
"
)
return
"
mountain
"
;
if
(
stroke
==
"
#0000ff
"
||
stroke
==
"
#00f
"
||
stroke
==
"
blue
"
||
stroke
==
"
rgb(0,0,255)
"
)
return
"
valley
"
;
if
(
stroke
==
"
#00ff00
"
||
stroke
==
"
#0f0
"
||
stroke
==
"
green
"
||
stroke
==
"
rgb(0,255,0)
"
)
return
"
cut
"
;
if
(
stroke
==
"
#ffff00
"
||
stroke
==
"
#ff0
"
||
stroke
==
"
yellow
"
||
stroke
==
"
rgb(255,255,0)
"
)
return
"
triangulation
"
;
if
(
stroke
==
"
#ff00ff
"
||
stroke
==
"
#f0f
"
||
stroke
==
"
magenta
"
||
stroke
==
"
rgb(255,0,255)
"
)
return
"
hinge
"
;
badColors
.
push
(
stroke
);
return
null
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment