Skip to content

Commit

Permalink
Merge pull request #13 from chrishutchinson/fix/singleDestination
Browse files Browse the repository at this point in the history
fix: Render correctly when only one service is available
  • Loading branch information
chrishutchinson authored Jun 9, 2019
2 parents cdb9f1a + 0c73a24 commit 24af66a
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,12 @@ def drawSignage(device, width, height, data):
rowTwoA = snapshot(callingWidth, 16, renderCallingAt, interval=100)
rowTwoB = snapshot(width - callingWidth, 16,
renderStations(", ".join(firstDepartureDestinations)), interval=0.1)
rowThreeA = snapshot(width - w, 16, renderDestination(
departures[1]), interval=10)
rowThreeB = snapshot(w, 16, renderServiceStatus(
departures[1]), interval=10)
if(len(departures) > 1):
rowThreeA = snapshot(width - w, 16, renderDestination(
departures[1]), interval=10)
rowThreeB = snapshot(w, 16, renderServiceStatus(
departures[1]), interval=10)

rowTime = snapshot(width, 14, renderTime, interval=1)

if len(virtualViewport._hotspots) > 0:
Expand All @@ -210,8 +212,10 @@ def drawSignage(device, width, height, data):
virtualViewport.add_hotspot(rowOneB, (width - w, 0))
virtualViewport.add_hotspot(rowTwoA, (0, 16))
virtualViewport.add_hotspot(rowTwoB, (callingWidth, 16))
virtualViewport.add_hotspot(rowThreeA, (0, 32))
virtualViewport.add_hotspot(rowThreeB, (width - w, 32))
if(len(departures) > 1):
virtualViewport.add_hotspot(rowThreeA, (0, 32))
virtualViewport.add_hotspot(rowThreeB, (width - w, 32))

virtualViewport.add_hotspot(rowTime, (0, 50))

return virtualViewport
Expand Down

0 comments on commit 24af66a

Please sign in to comment.