AnsweredAssumed Answered

Positioning Card Windows - Different on iPad vs. Desktop

Question asked by Mike_Mitchell Expert on Feb 19, 2018
Latest reply on Feb 20, 2018 by Mike_Mitchell

Good day, all. I'm having a very odd issue with positioning a card window. Here's the script I use to do it (in part):

 

 

Set Variable [ $param; Value:Get ( ScriptParameter ) ]

Set Variable [ $windowName; Value:cfUntrapJSON ( JSONGetElement ( $param ; "windowName" )) ]
Set Variable [ $parentWindowHeight; Value:cfUntrapJSON ( JSONGetElement ( $param ; "parentWindowHeight" )) ]

Set Variable [ $parentWindowWidth; Value:cfUntrapJSON ( JSONGetElement ( $param ; "parentWindowWidth" )) ]

 

Select Window [ Name: $windowName; Current file ]

Adjust Window [ Resize to Fit ]

 

If [ Get( LayoutViewState ) = 1 ]

  Move/Resize Window [ Name: $windowName; Current file; Height: Ceiling ( $parentWindowHeight * 2 / 3 ) ]

  Move/Resize Window [ Name: $windowName; Current file; Top: Ceiling (( $parentWindowHeight - Get ( WindowHeight )) / 2 ); Left: Ceiling (( $parentWindowWidth - Get ( WindowWidth )) / 2 ) ]

Else
   Move/Resize Window
[ Name: $windowName; Current file; Top: ( $parentWindowHeight - Get ( WindowHeight )) / 3; Left:

( $parentWindowWidth - Get ( WindowWidth )) / 2 ]

End If

 

 

The window height and width are fetched using Get ( WindowWidth ) and Get ( WindowHeight ) in the parent script. This is what I see on the desktop:

 

Screen Shot 2018-02-19 at 5.11.12 PM.png

 

Nicely centered in the parent window. But do the same thing on iPad, and I get:

 

IMG_B546B9E88F9A-1.jpeg

 

Note how the card appears further to the right on iPad than on desktop. The layout is exactly the same size, and it's sized to fit in iPad landscape (which is what the iPad is in at the time).

 

And it's not always consistent. Sometimes, the card appears too far to the left. Other times, too far down.

 

Is there some difference in the behavior of Get ( WindowWidth ) and Get ( WindowHeight ) I'm unaware of?

 

TIA

 

Mike

 

Outcomes