mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-07-24 07:57:22 +02:00
Merge df85826f31dfce3214186ff7011df0421f49a41e into 72212a892b75876364b8aadb72665325195066f5
This commit is contained in:
commit
593d941b55
@ -579,6 +579,19 @@ class CanvasExtraState {
|
|||||||
this.maxY = 0;
|
this.maxY = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isPathInClipBox() {
|
||||||
|
const {
|
||||||
|
clipBox: [x0, y0, x1, y1],
|
||||||
|
minX,
|
||||||
|
minY,
|
||||||
|
maxX,
|
||||||
|
maxY,
|
||||||
|
} = this;
|
||||||
|
return (
|
||||||
|
minX === Infinity || !(minX > x1 || maxX < x0 || minY > y1 || maxY < y0)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
getClippedPathBoundingBox(pathType = PathType.FILL, transform = null) {
|
getClippedPathBoundingBox(pathType = PathType.FILL, transform = null) {
|
||||||
return Util.intersect(
|
return Util.intersect(
|
||||||
this.clipBox,
|
this.clipBox,
|
||||||
@ -1762,6 +1775,9 @@ class CanvasGraphics {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stroke(consumePath = true) {
|
stroke(consumePath = true) {
|
||||||
|
if (!this.current.isPathInClipBox()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
const ctx = this.ctx;
|
const ctx = this.ctx;
|
||||||
const strokeColor = this.current.strokeColor;
|
const strokeColor = this.current.strokeColor;
|
||||||
// For stroke we want to temporarily change the global alpha to the
|
// For stroke we want to temporarily change the global alpha to the
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user