mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-16 22:03:37 +02:00
Fix display. This stuff now works.
This commit is contained in:
@@ -29,9 +29,11 @@ declare("iD.styleparser.Rule", null, {
|
||||
test:function(entity,tags,zoom) {
|
||||
// summary: Evaluate the Rule on the given entity, tags and zoom level.
|
||||
// returns: true if the Rule passes, false if the conditions aren't fulfilled.
|
||||
if (this.subject !== '' && !entity.entity.isType(this.subject)) { return false; }
|
||||
if ((this.subject !== '') && (entity.entityType !== this.subject)) {
|
||||
return false;
|
||||
}
|
||||
if (zoom<this.minZoom || zoom>this.maxZoom) { return false; }
|
||||
|
||||
|
||||
var v=true; var i=0; var isAnd=this.isAnd;
|
||||
array.forEach(this.conditions, function(condition) {
|
||||
var r=condition.test(tags);
|
||||
|
||||
@@ -62,20 +62,20 @@ declare("iD.styleparser.RuleChain", null, {
|
||||
|
||||
test:function(pos, entity, tags, zoom) {
|
||||
// summary: Test a rule chain by running all the tests in reverse order.
|
||||
if (this.rules.length==0) { return false; }
|
||||
if (this.rules.length === 0) { return false; }
|
||||
if (pos==-1) { pos=this.rules.length-1; }
|
||||
|
||||
var r=this.rules[pos];
|
||||
|
||||
var r = this.rules[pos];
|
||||
if (!r.test(entity, tags, zoom)) { return false; }
|
||||
if (pos==0) { return true; }
|
||||
|
||||
if (pos === 0) { return true; }
|
||||
|
||||
var o = entity.entity.parentObjects();
|
||||
for (var i=0; i<o.length; i++) {
|
||||
for (var i = 0; i < o.length; i++) {
|
||||
var p=o[i];
|
||||
if (this.test(pos-1, p, p.tags, zoom)) { return true; }
|
||||
}
|
||||
return false;
|
||||
},
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user