Merge pull request #398 from Vaelatern/fix-32bit-builds-without-int64

fix builds on 32bit systems
This commit is contained in:
Alexander Wang 2022-12-07 08:12:54 -08:00 committed by GitHub
commit 3c6039b852
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View file

@ -43,7 +43,7 @@ type sequenceDiagram struct {
} }
func getObjEarliestLineNum(o *d2graph.Object) int { func getObjEarliestLineNum(o *d2graph.Object) int {
min := int(math.MaxInt64) min := int(math.MaxInt32)
for _, ref := range o.References { for _, ref := range o.References {
if ref.MapKey == nil { if ref.MapKey == nil {
continue continue
@ -54,7 +54,7 @@ func getObjEarliestLineNum(o *d2graph.Object) int {
} }
func getEdgeEarliestLineNum(e *d2graph.Edge) int { func getEdgeEarliestLineNum(e *d2graph.Edge) int {
min := int(math.MaxInt64) min := int(math.MaxInt32)
for _, ref := range e.References { for _, ref := range e.References {
if ref.MapKey == nil { if ref.MapKey == nil {
continue continue

View file

@ -47,10 +47,10 @@ func (diagram Diagram) BoundingBox() (topLeft, bottomRight Point) {
if len(diagram.Shapes) == 0 { if len(diagram.Shapes) == 0 {
return Point{0, 0}, Point{0, 0} return Point{0, 0}, Point{0, 0}
} }
x1 := int(math.MaxInt64) x1 := int(math.MaxInt32)
y1 := int(math.MaxInt64) y1 := int(math.MaxInt32)
x2 := int(-math.MaxInt64) x2 := int(math.MinInt32)
y2 := int(-math.MaxInt64) y2 := int(math.MinInt32)
for _, targetShape := range diagram.Shapes { for _, targetShape := range diagram.Shapes {
x1 = go2.Min(x1, targetShape.Pos.X) x1 = go2.Min(x1, targetShape.Pos.X)