MCPcopy
hub / github.com/canvg/canvg / addPoint

Method addPoint

src/BoundingBox.ts:29–59  ·  view source on GitHub ↗
(x: number | undefined, y: number | undefined)

Source from the content-addressed store, hash-verified

27 }
28
29 addPoint(x: number | undefined, y: number | undefined) {
30 if (typeof x !== 'undefined') {
31 if (isNaN(this.x1) || isNaN(this.x2)) {
32 this.x1 = x
33 this.x2 = x
34 }
35
36 if (x < this.x1) {
37 this.x1 = x
38 }
39
40 if (x > this.x2) {
41 this.x2 = x
42 }
43 }
44
45 if (typeof y !== 'undefined') {
46 if (isNaN(this.y1) || isNaN(this.y2)) {
47 this.y1 = y
48 this.y2 = y
49 }
50
51 if (y < this.y1) {
52 this.y1 = y
53 }
54
55 if (y > this.y2) {
56 this.y2 = y
57 }
58 }
59 }
60
61 addX(x: number) {
62 this.addPoint(x, 0)

Callers 12

buildFunction · 0.95
constructorMethod · 0.95
addXMethod · 0.95
addYMethod · 0.95
addBoundingBoxMethod · 0.95
addBezierCurveMethod · 0.95
pathMethod · 0.95
pathMMethod · 0.80
pathLMethod · 0.80
pathHMethod · 0.80
pathVMethod · 0.80
pathAMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected