Skip to content

Commit

Permalink
don't output style if opacity and comp-op are defaults - refs less#219
Browse files Browse the repository at this point in the history
…and less#339
  • Loading branch information
Dane Springmeyer committed Apr 28, 2014
1 parent 4f771ed commit 4b38632
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/carto/tree/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,11 @@ tree.StyleXML = function(name, attachment, definitions, env) {
}).value().join(',') + '"';
}

if (comp_op.length) {
if (comp_op.length && comp_op[0].value.ev(env).value != 'src-over') {
attrs_xml += ' comp-op="' + comp_op[0].value.ev(env).toString() + '"';
}

if (opacity.length) {
if (opacity.length && opacity[0].value.ev(env).value != 1) {
attrs_xml += ' opacity="' + opacity[0].value.ev(env).toString() + '"';
}
var rule_string = rules.join('');
Expand Down
4 changes: 4 additions & 0 deletions test/rendering-mss/issue_339b.mss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#poi_label[maki=''] {
opacity:1.0;
comp-op:src-over;
}
Empty file.

0 comments on commit 4b38632

Please sign in to comment.