Move to 90° along the circle, not 0°
This commit is contained in:
@@ -313,7 +313,7 @@ ol.render.canvas.Replay.prototype.replay_ = function(
|
|||||||
var dx = x2 - x1;
|
var dx = x2 - x1;
|
||||||
var dy = y2 - y1;
|
var dy = y2 - y1;
|
||||||
var r = Math.sqrt(dx * dx + dy * dy);
|
var r = Math.sqrt(dx * dx + dy * dy);
|
||||||
context.moveTo(x2, y2);
|
context.moveTo(x1 + r, y1);
|
||||||
context.arc(x1, y1, r, 0, 2 * Math.PI, true);
|
context.arc(x1, y1, r, 0, 2 * Math.PI, true);
|
||||||
++i;
|
++i;
|
||||||
break;
|
break;
|
||||||
|
|||||||
BIN
test_rendering/spec/ol/layer/expected/vector-canvas-rotated.png
Normal file
BIN
test_rendering/spec/ol/layer/expected/vector-canvas-rotated.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
@@ -96,6 +96,26 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('renders rotation correctly with the canvas renderer', function(done) {
|
||||||
|
map = createMap('canvas');
|
||||||
|
map.getView().setRotation(Math.PI + Math.PI / 4);
|
||||||
|
addPolygon(300);
|
||||||
|
addCircle(500);
|
||||||
|
map.addLayer(new ol.layer.Vector({
|
||||||
|
source: source,
|
||||||
|
style: new ol.style.Style({
|
||||||
|
stroke: new ol.style.Stroke({
|
||||||
|
width: 2,
|
||||||
|
color: 'black'
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}));
|
||||||
|
map.once('postrender', function() {
|
||||||
|
expectResemble(map, 'spec/ol/layer/expected/vector-canvas-rotated.png',
|
||||||
|
1.7, done);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('renders fill/stroke batches correctly with the canvas renderer', function(done) {
|
it('renders fill/stroke batches correctly with the canvas renderer', function(done) {
|
||||||
map = createMap('canvas');
|
map = createMap('canvas');
|
||||||
source = new ol.source.Vector({
|
source = new ol.source.Vector({
|
||||||
|
|||||||
Reference in New Issue
Block a user