Skip to content
Snippets Groups Projects
Commit a845b080 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

Merge branch '830-async-data-overlay-init-might-cause-problems' into 'devel_13.1.x'

Resolve "MINERVANET - Error Report 74"

See merge request !804
parents e1aed7d7 f2782289
No related branches found
No related tags found
2 merge requests!805Merge 13.1.0 beta.1,!804Resolve "MINERVANET - Error Report 74"
Pipeline #10555 failed
...@@ -31,6 +31,8 @@ minerva (12.3.1~beta.1) unstable; urgency=low ...@@ -31,6 +31,8 @@ minerva (12.3.1~beta.1) unstable; urgency=low
* Bug fix: pathways can be drawn using glyphs (#825) * Bug fix: pathways can be drawn using glyphs (#825)
* Bug fix: empty background overlay doesn't show glyphs, instead standard * Bug fix: empty background overlay doesn't show glyphs, instead standard
visualization is used (#826) visualization is used (#826)
* Bug fix: asynchronous cals on showing/hiding data overlays might cause
problems due to network latency (#830)
minerva (13.1.0~beta.0) unstable; urgency=low minerva (13.1.0~beta.0) unstable; urgency=low
* Feature: annotators are more flexible - you can define set of input and * Feature: annotators are more flexible - you can define set of input and
......
...@@ -177,7 +177,11 @@ AliasSurface.prototype.setBoundsForAlias = function (startX, endX) { ...@@ -177,7 +177,11 @@ AliasSurface.prototype.setBoundsForAlias = function (startX, endX) {
var pointB = new Point(alias.getX() + endX * alias.getWidth(), alias.getY() + alias.getHeight()); var pointB = new Point(alias.getX() + endX * alias.getWidth(), alias.getY() + alias.getHeight());
var bounds = new Bounds(pointA, pointB); var bounds = new Bounds(pointA, pointB);
this.getMapCanvasObjects()[0].setBounds(bounds);
var mapCanvasObjects = this.getMapCanvasObjects();
for (var i = 0; i < mapCanvasObjects.length; i++) {
mapCanvasObjects[i].setBounds(bounds);
}
}; };
/** /**
......
...@@ -61,11 +61,30 @@ describe('AliasSurface', function () { ...@@ -61,11 +61,30 @@ describe('AliasSurface', function () {
var bounds = surface.getBounds(); var bounds = surface.getBounds();
surface.setBoundsForAlias(1, 3); surface.setBoundsForAlias(1, 3);
var bounds2 = surface.getBounds(); var bounds2 = surface.getBounds();
assert.equal(bounds.getRightBottom().y, bounds2.getRightBottom().y); assert.equal(bounds.getRightBottom().y, bounds2.getRightBottom().y, helper.EPSILON);
assert.ok(bounds.getRightBottom().x !== bounds2.getRightBottom().x); assert.ok(bounds.getRightBottom().x !== bounds2.getRightBottom().x);
}); });
}); });
it("before alias init", function () {
var map;
var alias, surface;
return ServerConnector.getProject().then(function (project) {
map = helper.createCustomMap(project);
return map.getModel().getAliasById(329171);
}).then(function (result) {
alias = result;
surface = new AliasSurface({
alias: result,
overlayData: [helper.createLayoutAlias(alias)],
map: map
});
surface.setBoundsForAlias(1, 3);
var bounds = surface.getBounds();
assert.ok(bounds);
});
});
it("from element with data overlay", function () { it("from element with data overlay", function () {
var map = helper.createCustomMap(); var map = helper.createCustomMap();
var alias = helper.createAlias(map); var alias = helper.createAlias(map);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment