Skip to content

Commit

Permalink
fix ArcCurve clip error (#2370)
Browse files Browse the repository at this point in the history
  • Loading branch information
deyihu authored Jul 3, 2024
1 parent eeefedb commit 4b19181
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/renderer/geometry/Painter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ class Painter extends Class {
const clipBBoxBufferSize = renderer.layer.options['clipBBoxBufferSize'] || 3;
const symbolizers = this.symbolizers;

const enableClip = geometry.options.enableClip;

function pointsContainerPoints(viewPoints = [], alts = []) {
let pts = getPointsResultPts(viewPoints, ptkey);
pts = map._pointsAtResToContainerPoints(viewPoints, glRes, alts, pts);
Expand All @@ -314,7 +316,7 @@ class Painter extends Class {
maxx = Math.max(p.x, maxx);
maxy = Math.max(p.y, maxy);
}
if (needClip && isDashLine(symbolizers)) {
if (enableClip && needClip && isDashLine(symbolizers)) {
TEMP_CLIP_EXTENT2.ymin = containerExtent.ymin;
if (TEMP_CLIP_EXTENT2.ymin < clipBBoxBufferSize) {
TEMP_CLIP_EXTENT2.ymin = containerExtent.ymin - clipBBoxBufferSize;
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/layer/vectorlayer/VectorLayerCanvasRenderer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/ban-types */
import { getExternalResources, now, getPointsResultPts, type Vector3 } from '../../../core/util';
import { getExternalResources, now, getPointsResultPts, type Vector3, isNil } from '../../../core/util';
import VectorLayer from '../../../layer/VectorLayer';
import OverlayLayerCanvasRenderer from './OverlayLayerCanvasRenderer';
import Extent from '../../../geo/Extent';
Expand Down Expand Up @@ -334,7 +334,7 @@ class VectorLayerRenderer extends OverlayLayerCanvasRenderer {

const painter = geo._getPainter();
let inCurrentView = true;
if (geo._inCurrentView || geo.hasAltitude()) {
if (geo._inCurrentView || !isNil(geo.options.arcDegree) || geo.hasAltitude()) {
inCurrentView = true;
} else if (geo._inCurrentView === false) {
inCurrentView = false;
Expand Down

0 comments on commit 4b19181

Please sign in to comment.