--- fullscreenform.c.orig	Tue Sep  9 20:25:23 2003
+++ fullscreenform.c	Fri Sep 19 21:43:18 2003
@@ -33,6 +33,7 @@
 #include "os.h"
 #include "prefsdata.h"
 #include "resourceids.h"
+#include "rotate.h"
 #include "screen.h"
 #include "table.h"
 #include "util.h"
@@ -128,6 +129,8 @@
     if ( image == NULL || image->err != errNone )
         return false;
 
+    fullscreenformActive = true;
+
     fsForm = FrmGetFormPtr( GetValidForm( frmFullscreen ) );
 
     FrmDrawForm( fsForm );
@@ -176,6 +179,9 @@
     ctlBounds.extent.x += 2;
     ctlBounds.extent.y += 2;
     HiResAdjustBounds( &ctlBounds, sonyHiRes );
+    RotateRectangleInPlace( &ctlBounds );
+    FrmSetObjectBounds( fsForm, FrmGetObjectIndex( fsForm, frmFullscreenBack ),
+        &ctlBounds );
 
     /* Pre-lock any subimages */
     if ( image->type == MULTIIMAGE ) {
@@ -195,8 +201,6 @@
     if ( IsLargeTable() )
         CopyTableAnchors( image->reference, 0, 0 );
 
-    fullscreenformActive = true;
-
     return true;
 }
 
@@ -289,7 +293,7 @@
             WinCopyRectangle( thisImage->data.window, screenWindow,
                               &screenBounds, 0, 0, winPaint );
         else {
-            GeneralWinDrawBitmap( thisImage->bitmap, drawX, drawY );
+            RotDrawBitmap( thisImage->bitmap, drawX, drawY );
         }
         /* Specifically erase any whitespace beyound the image's bounds */
         if ( imageBounds.extent.x < screenBounds.extent.x ) {
@@ -298,7 +302,7 @@
             whitespace.extent.y  = screenBounds.extent.y;
             whitespace.extent.x  = screenBounds.extent.x - imageBounds.extent.x;
 
-            WinEraseRectangle( &whitespace, 0 );
+            RotEraseRectangle( &whitespace, 0 );
         }
         if ( imageBounds.extent.y < screenBounds.extent.y ) {
             whitespace.topLeft.x = 0;
@@ -306,7 +310,7 @@
             whitespace.extent.x  = screenBounds.extent.x;
             whitespace.extent.y  = screenBounds.extent.y - imageBounds.extent.y;
 
-            WinEraseRectangle( &whitespace, 0 );
+            RotEraseRectangle( &whitespace, 0 );
         }
 
         PalmSetCoordinateSystem( prevCoordSys );
@@ -339,8 +343,8 @@
                                (UInt32) frameBounds.extent.y /
                                (UInt32) imageBounds.extent.y;
 
-    WinDrawGrayRectangleFrame( simpleFrame, &frameBounds );
-    WinDrawGrayRectangleFrame( simpleFrame, &viewAreaBounds );
+    RotDrawGrayRectangleFrame( simpleFrame, &frameBounds );
+    RotDrawGrayRectangleFrame( simpleFrame, &viewAreaBounds );
 }
 
 
@@ -712,7 +716,10 @@
 {
     /* Since we don't want to move the image if we're clicking on
        any of the control buttons, we'll break early */
-    if ( RctPtInRectangle( x, y, &ctlBounds ) )
+    RectangleType rotXY = { { x, y }, { 0, 0 } };
+
+    RotateRectangleInPlace( &rotXY );
+    if ( RctPtInRectangle( rotXY.topLeft.x, rotXY.topLeft.y, &ctlBounds ) )
         return false;
 
     penDownInFrame = RctPtInRectangle( x, y, &frameBounds );
@@ -760,6 +767,7 @@
 
     penX = event->screenX;
     penY = event->screenY;
+    RotFromScreenXY( &penX, &penY );
     HiResAdjust( &penX, sonyHiRes );
     HiResAdjust( &penY, sonyHiRes );
 
--- rotate.c.orig	Sat Sep 13 16:45:44 2003
+++ rotate.c	Fri Sep 19 21:21:08 2003
@@ -30,6 +30,7 @@
 #include "os.h"
 #include "rotatebitmap.h"
 #include "const.h"
+#include "fullscreenform.h"
 
 #define NO_GRAY_FONT_SUBSTITUTION
 #include "rotate.h"
@@ -171,15 +172,27 @@
         case ROTATE_PLUS90:
             multiplierX = -1;
             multiplierY = 1;
-            deltaX = TopLeftX();
-            deltaY = TopLeftY() + ExtentY() - 1;
+            if( IsFullscreenformActive() ) {
+                deltaX = 0;
+                deltaY = MaxExtentY() - 1;
+            }
+            else {
+                deltaX = TopLeftX();
+                deltaY = TopLeftY() + ExtentY() - 1;
+            }
             clockwise = false;
             return true;
         case ROTATE_MINUS90:
             multiplierX = 1;
             multiplierY = -1;
-            deltaX = TopLeftX() + ExtentX() - 1;
-            deltaY = TopLeftY();
+            if( IsFullscreenformActive() ) {
+                deltaX = MaxExtentX() - 1;
+                deltaY = 0;
+            }
+            else {
+                deltaX = TopLeftX() + ExtentX() - 1;
+                deltaY = TopLeftY();
+            }
             clockwise = true;
             return true;
         default:
@@ -197,15 +210,27 @@
         case ROTATE_PLUS90:
             multiplierX = 1;
             multiplierY = -1;
-            deltaX = TopLeftY() + ExtentY() - 1;
-            deltaY = -TopLeftX();
+            if( IsFullscreenformActive() ) {
+                deltaX = MaxExtentY() - 1;
+                deltaY = 0;
+            }
+            else {
+                deltaX = TopLeftY() + ExtentY() - 1;
+                deltaY = -TopLeftX();
+            }
             clockwise = true;
             return true;
         case ROTATE_MINUS90:
             multiplierX = -1;
             multiplierY = 1;
-            deltaX = -TopLeftY();
-            deltaY = TopLeftX() + ExtentX() - 1;
+            if( IsFullscreenformActive() ) {
+                deltaX = 0;
+                deltaY = MaxExtentX() - 1;
+            }
+            else {
+                deltaX = -TopLeftY();
+                deltaY = TopLeftX() + ExtentX() - 1;
+            }
             clockwise = false;
             return true;
         default:
