Do not optimize lines away entirely
This commit is contained in:
@@ -489,7 +489,7 @@ ol.render.canvas.Replay.prototype.replay_ = function(
|
|||||||
y = pixelCoordinates[d + 1];
|
y = pixelCoordinates[d + 1];
|
||||||
roundX = (x + 0.5) | 0;
|
roundX = (x + 0.5) | 0;
|
||||||
roundY = (y + 0.5) | 0;
|
roundY = (y + 0.5) | 0;
|
||||||
if (roundX !== prevX || roundY !== prevY) {
|
if (d == dd - 2 || roundX !== prevX || roundY !== prevY) {
|
||||||
context.lineTo(x, y);
|
context.lineTo(x, y);
|
||||||
prevX = roundX;
|
prevX = roundX;
|
||||||
prevY = roundY;
|
prevY = roundY;
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.2 KiB |
@@ -49,6 +49,15 @@ describe('ol.rendering.layer.Vector', function() {
|
|||||||
|
|
||||||
it('renders correctly with the canvas renderer', function(done) {
|
it('renders correctly with the canvas renderer', function(done) {
|
||||||
map = createMap('canvas');
|
map = createMap('canvas');
|
||||||
|
var smallLine = new ol.Feature(new ol.geom.LineString([
|
||||||
|
[center[0], center[1] - 1],
|
||||||
|
[center[0], center[1] + 1]
|
||||||
|
]));
|
||||||
|
smallLine.setStyle(new ol.style.Style({
|
||||||
|
zIndex: -99,
|
||||||
|
stroke: new ol.style.Stroke({width: 75, color: 'red'})
|
||||||
|
}));
|
||||||
|
source.addFeature(smallLine);
|
||||||
addPolygon(100);
|
addPolygon(100);
|
||||||
addCircle(200);
|
addCircle(200);
|
||||||
addPolygon(250);
|
addPolygon(250);
|
||||||
|
|||||||
Reference in New Issue
Block a user