Support variables and expressions as the arguments to functions.
This commit is contained in:
parent
593092fedd
commit
e27ce12ea0
@ -62,13 +62,17 @@ tree.Call.prototype = {
|
||||
toString: function(env, format) {
|
||||
if (format === 'image-filter') {
|
||||
if (this.args.length) {
|
||||
return this.name + ':' + this.args.join(',');
|
||||
return this.name + ':' + this.args.map(function(a) {
|
||||
return a.eval(env);
|
||||
}).join(',');
|
||||
} else {
|
||||
return this.name;
|
||||
}
|
||||
} else {
|
||||
if (this.args.length) {
|
||||
return this.name + '(' + this.args.join(',') + ')';
|
||||
return this.name + '(' + this.args.map(function(a) {
|
||||
return a.eval(env);
|
||||
}).join(',') + ')';
|
||||
} else {
|
||||
return this.name;
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
@trans: 2;
|
||||
#world {
|
||||
point-file: url(foo.png);
|
||||
point-transform: translate(2, 2);
|
||||
point-transform: translate(@trans * 2, @trans);
|
||||
}
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
<Style name="world" filter-mode="first" >
|
||||
<Rule>
|
||||
<PointSymbolizer file="foo.png" transform="translate(2,2)" />
|
||||
<PointSymbolizer file="foo.png" transform="translate(4,2)" />
|
||||
</Rule>
|
||||
</Style>
|
||||
<Layer name="world"
|
||||
|
Loading…
Reference in New Issue
Block a user