Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

[Seating map] _ Fixed distance between seats

$
0
0

@nxhoang wrote:

Dear all,

I’m using this function to generate seats.

      function RecSeats(total, seatAlign) {
            var seats = [];
            
            if (total > 0) {
                let px = seatAlign;
                let py = 0;
                
                for (var i = 1; i <= total; i++) {                    
                    console.log(px);
                    
                    if(i % 2 === 0){
                        seats.push(Seat(i, new go.Spot(px, 1))); 
                        px = px + seatAlign;
                    }else{                        
                        seats.push(Seat(i, new go.Spot(px, 0)));
                    }
                    
                    console.log(new go.Spot(px, py)); 
                }
            }
            
            return seats;
        }

It generates seats opposite like this as my expectation.

image

The problem is the distance between seats is not fixed.
I want it is fixed based on input value.
So the distance between seat 1, 3, 5, … for both tables should be as the same.
Thanks you in advanced.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles