Skip to content

Commit f38efee

Browse files
committed
perf: Do not update the feature modified time when changing visibility
This caused needless rebuilds of features and does not change exposed behavior
1 parent 58a8560 commit f38efee

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/feature.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -733,7 +733,6 @@ var feature = function (arg) {
733733
}
734734
if (m_visible !== val || direct) {
735735
m_visible = val;
736-
m_this.modified();
737736
if (m_layer && m_layer.visible && !m_layer.visible()) {
738737
val = false;
739738
}

tests/cases/feature.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ describe('geo.feature', function () {
201201
var modTime = feat.timestamp();
202202
expect(feat.visible(false)).toBe(feat);
203203
expect(feat.visible()).toBe(false);
204-
expect(feat.timestamp()).toBeGreaterThan(modTime);
204+
expect(feat.timestamp()).toBe(modTime);
205205

206206
expect(feat.visible(true)).toBe(feat);
207207
var depFeat = geo.feature({layer: layer, renderer: layer.renderer()});
@@ -210,7 +210,7 @@ describe('geo.feature', function () {
210210
expect(feat.visible(false)).toBe(feat);
211211
expect(feat.visible()).toBe(false);
212212
expect(depFeat.visible()).toBe(false);
213-
expect(depFeat.timestamp()).toBeGreaterThan(modTime);
213+
expect(depFeat.timestamp()).toBe(modTime);
214214
feat.dependentFeatures([]);
215215
expect(feat.visible(true)).toBe(feat);
216216
expect(depFeat.visible()).toBe(false);

0 commit comments

Comments
 (0)