diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c
index bc55e71..f449732 100644
--- a/win32ss/gdi/ntgdi/freetype.c
+++ b/win32ss/gdi/ntgdi/freetype.c
@@ -705,11 +705,11 @@ FtMatrixFromMx(FT_Matrix *pmat, PMATRIX pmx)
     FLOATOBJ_MulLong(&ef, 0x00010000);
     pmat->xx = FLOATOBJ_GetLong(&ef);
 
-    ef = pmx->efM21;
+    ef = pmx->efM12;
     FLOATOBJ_MulLong(&ef, 0x00010000);
     pmat->xy = FLOATOBJ_GetLong(&ef);
 
-    ef = pmx->efM12;
+    ef = pmx->efM21;
     FLOATOBJ_MulLong(&ef, 0x00010000);
     pmat->yx = FLOATOBJ_GetLong(&ef);
 
@@ -5601,7 +5601,7 @@ IntExtTextOutW(
     FT_Face face;
     FT_GlyphSlot glyph;
     FT_BitmapGlyph realglyph;
-    LONGLONG TextLeft64, TextTop64, DeltaX64, DeltaY64, XStart64, YStart64;
+    LONGLONG TextLeft64, TextTop64, TextWidth64, RealXStart64;
     ULONG previous;
     FT_Bool use_kerning;
     RECTL DestRect, MaskRect;
@@ -5625,8 +5625,10 @@ IntExtTextOutW(
     BOOL EmuBold, EmuItalic;
     int thickness;
     BOOL bResult;
-    FT_Matrix mat = identityMat, matWidth, matEscape, matWorld;
+    INT DY1, DY2;
+    FT_Matrix mat1, mat2 = identityMat;
     FT_Vector vecs[9];
+    POINT pts[9];
 
     /* Check if String is valid */
     if ((Count > 0xFFFF) || (Count > 0 && String == NULL))
@@ -5666,7 +5668,7 @@ IntExtTextOutW(
         IntLPtoDP(dc, (POINT *)lprc, 2);
     }
 
-    if (pdcattr->flTextAlign & TA_UPDATECP)
+    if (pdcattr->lTextAlign & TA_UPDATECP)
     {
         Start.x = pdcattr->ptlCurrent.x;
         Start.y = pdcattr->ptlCurrent.y;
@@ -5675,6 +5677,10 @@ IntExtTextOutW(
         Start.y = YStart;
     }
 
+    IntLPtoDP(dc, &Start, 1);
+    RealXStart64 = ((LONGLONG)Start.x + dc->ptlDCOrig.x) << 6;
+    YStart = Start.y + dc->ptlDCOrig.y;
+
     SourcePoint.x = 0;
     SourcePoint.y = 0;
     MaskRect.left = 0;
@@ -5772,39 +5778,55 @@ IntExtTextOutW(
     }
 
     /* NOTE: Don't trust face->size->metrics.ascender and descender values. */
-    DC_vUpdateWorldToDevice(dc);
     if (dc->pdcattr->iGraphicsMode == GM_ADVANCED)
     {
         pmxWorldToDevice = DC_pmxWorldToDevice(dc);
+        FtSetCoordinateTransform(face, pmxWorldToDevice);
     }
     else
     {
         pmxWorldToDevice = (PMATRIX)&gmxWorldToDeviceDefault;
+        FtSetCoordinateTransform(face, pmxWorldToDevice);
     }
 
-    IntWidthMatrix(face, &matWidth, lfWidth);
-    FT_Matrix_Multiply(&matWidth, &mat);
-
-    IntEscapeMatrix(&matEscape, lfEscapement);
-    FT_Matrix_Multiply(&matEscape, &mat);
-
-    FtMatrixFromMx(&matWorld, pmxWorldToDevice);
-    matWorld.yx = -matWorld.yx;
-    matWorld.xy = -matWorld.xy;
-    FT_Matrix_Multiply(&matWorld, &mat);
+    /*
+     * Process the vertical alignment and determine DY1 and DY2.
+     */
+#define VALIGN_MASK  (TA_TOP | TA_BASELINE | TA_BOTTOM)
+    if ((pdcattr->lTextAlign & VALIGN_MASK) == TA_BASELINE)
+    {
+        DY1 = FontGDI->tmAscent;
+        DY2 = FontGDI->tmDescent;
+    }
+    else if ((pdcattr->lTextAlign & VALIGN_MASK) == TA_BOTTOM)
+    {
+        DY1 = FontGDI->tmHeight;
+        DY2 = 0;
+    }
+    else /* TA_TOP */
+    {
+        DY1 = 0;
+        DY2 = FontGDI->tmHeight;
+    }
+#undef VALIGN_MASK
 
-    FT_Set_Transform(face, &mat, NULL);
+    IntWidthMatrix(face, &mat1, lfWidth);
+    FT_Matrix_Multiply(&mat1, &mat2);
+    FT_Set_Transform(face, &mat2, NULL);
 
-    // Calculate displacement of the text.
-    DeltaX64 = DeltaY64 = 0;
+    /*
+     * Calculate width of the text.
+     */
+    TextWidth64 = 0;
     DxShift = fuOptions & ETO_PDY ? 1 : 0;
     use_kerning = FT_HAS_KERNING(face);
     previous = 0;
     if ((fuOptions & ETO_OPAQUE) ||
-        (pdcattr->flTextAlign & (TA_CENTER | TA_RIGHT)) ||
-        memcmp(&mat, &identityMat, sizeof(mat)) != 0 ||
-        plf->lfUnderline || plf->lfStrikeOut)
+        (pdcattr->lTextAlign & (TA_CENTER | TA_RIGHT)) ||
+        lfEscapement || plf->lfUnderline || plf->lfStrikeOut)
     {
+        TextLeft64 = RealXStart64;
+        TextTop64 = YStart << 6;
         for (i = 0; i < Count; ++i)
         {
             glyph_index = get_glyph_index_flagged(face, String[i], ETO_GLYPH_INDEX, fuOptions);
@@ -5838,52 +5860,50 @@ IntExtTextOutW(
             {
                 FT_Vector delta;
                 FT_Get_Kerning(face, previous, glyph_index, 0, &delta);
-                DeltaX64 += delta.x;
-                DeltaY64 -= delta.y;
+                TextLeft64 += delta.x;
             }
 
             if (Dx == NULL)
             {
-                DeltaX64 += realglyph->root.advance.x >> 10;
-                DeltaY64 -= realglyph->root.advance.y >> 10;
+                TextLeft64 += realglyph->root.advance.x >> 10;
             }
             else
             {
-                // FIXME this should probably be a matrix transform with DeltaY64 as well.
+                // FIXME this should probably be a matrix transform with TextTop64 as well.
                 Scale = pdcattr->mxWorldToDevice.efM11;
                 if (FLOATOBJ_Equal0(&Scale))
                     FLOATOBJ_Set1(&Scale);
 
                 /* do the shift before multiplying to preserve precision */
                 FLOATOBJ_MulLong(&Scale, Dx[i << DxShift] << 6);
-                DeltaX64 += FLOATOBJ_GetLong(&Scale);
+                TextLeft64 += FLOATOBJ_GetLong(&Scale);
             }
 
             if (DxShift)
             {
-                DeltaY64 -= Dx[2 * i + 1] << 6;
+                TextTop64 -= Dx[2 * i + 1] << 6;
             }
 
             previous = glyph_index;
 
             FT_Done_Glyph((FT_Glyph)realglyph);
         }
-    }
 
-    // Process the X and Y alignments.
-    if ((pdcattr->flTextAlign & TA_CENTER) == TA_CENTER)
-    {
-        XStart64 = -DeltaX64 / 2;
-        YStart64 = -DeltaY64 / 2;
+        TextWidth64 = TextLeft64 - RealXStart64;
     }
-    else if ((pdcattr->flTextAlign & TA_RIGHT) == TA_RIGHT)
+
+    /*
+     * Process the horizontal alignment and modify XStart accordingly.
+     */
+    if ((pdcattr->lTextAlign & TA_CENTER) == TA_CENTER)
     {
-        XStart64 = -DeltaX64;
-        YStart64 = -DeltaY64;
+        RealXStart64 -= TextWidth64 / 2;
     }
-    else
+    else if ((pdcattr->lTextAlign & TA_RIGHT) == TA_RIGHT)
     {
-        XStart64 = YStart64 = 0;
+        RealXStart64 -= TextWidth64;
+        if (((RealXStart64 + TextWidth64 + 32) >> 6) <= Start.x + dc->ptlDCOrig.x)
+            RealXStart64 += 1 << 6;
     }
 
     psurf = dc->dclevel.pSurface;
@@ -5892,7 +5912,7 @@ IntExtTextOutW(
     if ((fuOptions & ETO_OPAQUE) && (dc->pdcattr->ulDirty_ & DIRTY_BACKGROUND))
         DC_vUpdateBackgroundBrush(dc) ;
 
-    if (dc->pdcattr->ulDirty_ & DIRTY_TEXT)
+    if(dc->pdcattr->ulDirty_ & DIRTY_TEXT)
         DC_vUpdateTextBrush(dc) ;
 
     thickness = 1;
@@ -5904,30 +5924,23 @@ IntExtTextOutW(
             thickness = 1;
     }
 
-    /* Process the vertical alignment */
-#define VALIGN_MASK  (TA_TOP | TA_BASELINE | TA_BOTTOM)
-    RtlZeroMemory(vecs, sizeof(vecs));
-    if ((pdcattr->flTextAlign & VALIGN_MASK) == TA_BASELINE)
-    {
-        vecs[1].y = -FontGDI->tmAscent << 16;   // upper left
-        vecs[4].y = 0;                          // baseline
-        vecs[0].y = FontGDI->tmDescent << 16;   // lower left
-    }
-    else if ((pdcattr->flTextAlign & VALIGN_MASK) == TA_BOTTOM)
-    {
-        vecs[1].y = -FontGDI->tmHeight << 16;   // upper left
-        vecs[4].y = -FontGDI->tmDescent << 16;  // baseline
-        vecs[0].y = 0;                          // lower left
-    }
-    else /* TA_TOP */
-    {
-        vecs[1].y = 0;                          // upper left
-        vecs[4].y = FontGDI->tmAscent << 16;    // baseline
-        vecs[0].y = FontGDI->tmHeight << 16;    // lower left
-    }
-    vecs[2] = vecs[1];      // upper right
-    vecs[3] = vecs[0];      // lower right
-#undef VALIGN_MASK
+    IntEscapeMatrix(&mat1, lfEscapement);
+    FT_Matrix_Multiply(&mat1, &mat2);
+    FT_Set_Transform(face, &mat2, NULL);
+
+    // background rectangle
+    vecs[0].x = 0;
+    vecs[0].y = (DY1 - FontGDI->tmHeight) << 16;    // Top Left
+    vecs[1].x = TextWidth64 << 10;
+    vecs[1].y = (DY1 - FontGDI->tmHeight) << 16;    // Top Right
+    vecs[2].x = TextWidth64 << 10;
+    vecs[2].y = DY1 << 16;                          // Bottom Right
+    vecs[3].x = 0;
+    vecs[3].y = DY1 << 16;                          // Bottom Left
+
+    // the starting point
+    vecs[4].x = 0;
+    vecs[4].y = (DY1 - FontGDI->tmAscent) << 16;
 
     // underline
     if (plf->lfUnderline)
@@ -5938,75 +5951,65 @@ IntExtTextOutW(
             position = face->underline_position *
                 face->size->metrics.y_ppem / face->units_per_EM;
         }
-        vecs[5].y = vecs[6].y = vecs[4].y - (position << 16);
+        vecs[5].x = 0;
+        vecs[5].y = (DY1 - FontGDI->tmAscent + position) << 16;
+        vecs[6].x = TextWidth64 << 10;
+        vecs[6].y = (DY1 - FontGDI->tmAscent + position) << 16;
     }
 
     // strike through
     if (plf->lfStrikeOut)
     {
-        vecs[7].y = vecs[8].y = vecs[4].y - ((FontGDI->tmAscent / 3) << 16);
+        vecs[7].x = 0;
+        vecs[7].y = (DY1 - FontGDI->tmAscent + (FontGDI->tmAscent / 3)) << 16;
+        vecs[8].x = TextWidth64 << 10;
+        vecs[8].y = (DY1 - FontGDI->tmAscent + (FontGDI->tmAscent / 3)) << 16;
     }
 
-    // invert y axis
-    IntEscapeMatrix(&matEscape, -lfEscapement);
-
-    matWorld.yx = -matWorld.yx;
-    matWorld.xy = -matWorld.xy;
-
-    // convert vecs
+    // convert vecs to pts
     for (i = 0; i < 9; ++i)
     {
-        FT_Vector_Transform(&vecs[i], &matWidth);
-        FT_Vector_Transform(&vecs[i], &matEscape);
-        FT_Vector_Transform(&vecs[i], &matWorld);
-    }
-    vecs[2].x += DeltaX64 << 10;
-    vecs[2].y += DeltaY64 << 10;     // upper right
-    vecs[3].x += DeltaX64 << 10;
-    vecs[3].y += DeltaY64 << 10;     // lower right
-    vecs[6].x += DeltaX64 << 10;
-    vecs[6].y += DeltaY64 << 10;     // underline right
-    vecs[8].x += DeltaX64 << 10;
-    vecs[8].y += DeltaY64 << 10;     // strike through right
-
-    {
-        POINT pt;
-        pt.x = Start.x + (XStart64 >> 6);
-        pt.y = Start.y + (YStart64 >> 6);
-        IntLPtoDP(dc, &pt, 1);
-
-        for (i = 0; i < 9; ++i)
-        {
-            vecs[i].x += pt.x << 16;
-            vecs[i].y += pt.y << 16;
-            vecs[i].x >>= 16;
-            vecs[i].y >>= 16;
-            vecs[i].x += dc->ptlDCOrig.x;
-            vecs[i].y += dc->ptlDCOrig.y;
-        }
+        FT_Vector_Transform(&vecs[i], &mat1);
+        pts[i].x = (RealXStart64 >> 6) + (vecs[i].x >> 16);
+        pts[i].y = YStart - (vecs[i].y >> 16);
     }
 
     if (fuOptions & ETO_OPAQUE)
     {
         /* Draw background */
         RECTL Rect;
-        RtlZeroMemory(&Rect, sizeof(Rect));
+        INT X1 = ((RealXStart64 + 32) >> 6);
 
-        if ((mat.xy == 0 && mat.yx == 0) || (mat.xx == 0 && mat.yy == 0))
+        switch (lfEscapement)
         {
-            Rect.left = Rect.top = MAXLONG;
-            Rect.right = Rect.bottom = MINLONG;
-            for (i = 0; i < 4; ++i)
-            {
-                Rect.left = min(Rect.left, vecs[i].x);
-                Rect.top = min(Rect.top, vecs[i].y);
-                Rect.right = max(Rect.right, vecs[i].x);
-                Rect.bottom = max(Rect.bottom, vecs[i].y);
-            }
-        }
-        else
-        {
-            // FIXME: Use vecs[0] ... vecs[3] and EngFillPath
+        case 0:
+            Rect.left = X1;
+            Rect.top = ((TextTop64 + 32) >> 6) - DY1;
+            Rect.right = (RealXStart64 + TextWidth64 + 32) >> 6;
+            Rect.bottom = ((TextTop64 + 32) >> 6) + DY2;
+            break;
+        case 90 * 10:
+            Rect.left = X1 - DY1;
+            Rect.top = ((TextTop64 - TextWidth64 + 32) >> 6);
+            Rect.right = X1 + DY2;
+            Rect.bottom = ((TextTop64 + 32) >> 6);
+            break;
+        case 180 * 10:
+            Rect.left = (RealXStart64 - TextWidth64 + 32) >> 6;
+            Rect.top = ((TextTop64 + 32) >> 6) - DY2;
+            Rect.right = X1;
+            Rect.bottom = ((TextTop64 + 32) >> 6) + DY1;
+            break;
+        case 270 * 10:
+            Rect.left = X1 - DY2;
+            Rect.top = ((TextTop64 + 32) >> 6);
+            Rect.right = X1 + DY1;
+            Rect.bottom = ((TextTop64 + TextWidth64 + 32) >> 6);
+            break;
+        default:
+            DPRINT1("FIXME: Not implemented lfEscapement\n");
+            RtlZeroMemory(&Rect, sizeof(Rect));
+            // FIXME: Use pts[0] ... pts[3] and EngFillPath
         }
 
         if (dc->fs & (DC_ACCUM_APP | DC_ACCUM_WMGR))
@@ -6043,18 +6046,18 @@ IntExtTextOutW(
     EXLATEOBJ_vInitialize(&exloRGB2Dst, &gpalRGB, psurf->ppal, 0, 0, 0);
     EXLATEOBJ_vInitialize(&exloDst2RGB, psurf->ppal, &gpalRGB, 0, 0, 0);
 
-    // The main rendering loop.
+    /*
+     * The main rendering loop.
+     */
     bResult = TRUE;
-    TextLeft64 = vecs[4].x << 6;
-    TextTop64 = vecs[4].y << 6;
+    TextLeft64 = pts[4].x << 6;
+    TextTop64 = pts[4].y << 6;
     previous = 0;
     for (i = 0; i < Count; ++i)
     {
-        BOOL bNeedCache = (!EmuBold && !EmuItalic &&
-                           memcmp(&mat, &identityMat, sizeof(mat)) == 0);
         glyph_index = get_glyph_index_flagged(face, String[i], ETO_GLYPH_INDEX, fuOptions);
         realglyph = NULL;
-        if (bNeedCache)
+        if (!EmuBold && !EmuItalic && !lfEscapement)
         {
             realglyph = ftGdiGlyphCacheGet(face, glyph_index, plf->lfHeight,
                                            RenderMode, pmxWorldToDevice);
@@ -6068,8 +6071,17 @@ IntExtTextOutW(
                 bResult = FALSE;
                 break;
             }
+
             glyph = face->glyph;
-            if (bNeedCache)
+            if (EmuBold || EmuItalic || lfEscapement)
+            {
+                if (EmuBold)
+                    FT_GlyphSlot_Embolden(glyph);
+                if (EmuItalic)
+                    FT_GlyphSlot_Oblique(glyph);
+                realglyph = ftGdiGlyphSet(face, glyph, RenderMode);
+            }
+            else
             {
                 realglyph = ftGdiGlyphCacheSet(face,
                                                glyph_index,
@@ -6078,14 +6090,6 @@ IntExtTextOutW(
                                                glyph,
                                                RenderMode);
             }
-            else
-            {
-                if (EmuBold)
-                    FT_GlyphSlot_Embolden(glyph);
-                if (EmuItalic)
-                    FT_GlyphSlot_Oblique(glyph);
-                realglyph = ftGdiGlyphSet(face, glyph, RenderMode);
-            }
             if (!realglyph)
             {
                 DPRINT1("Failed to render glyph! [index: %d]\n", glyph_index);
@@ -6100,7 +6104,6 @@ IntExtTextOutW(
             FT_Vector delta;
             FT_Get_Kerning(face, previous, glyph_index, 0, &delta);
             TextLeft64 += delta.x;
-            TextTop64 -= delta.y;
         }
         DPRINT("TextLeft64: %I64d\n", TextLeft64);
         DPRINT("TextTop64: %I64d\n", TextTop64);
@@ -6210,7 +6213,6 @@ IntExtTextOutW(
             TextLeft64 += realglyph->root.advance.x >> 10;
             TextTop64 -= realglyph->root.advance.y >> 10;
             DPRINT("New TextLeft64: %I64d\n", TextLeft64);
-            DPRINT("New TextTop64: %I64d\n", TextTop64);
         }
         else
         {
@@ -6233,7 +6235,7 @@ IntExtTextOutW(
         previous = glyph_index;
 
         /* No cache, so clean up */
-        if (!bNeedCache)
+        if (EmuBold || EmuItalic || lfEscapement)
         {
             FT_Done_Glyph((FT_Glyph)realglyph);
         }
@@ -6241,26 +6243,43 @@ IntExtTextOutW(
 
     if (plf->lfUnderline || plf->lfStrikeOut)
     {
-        INT x0 = min(vecs[0].x, vecs[2].x);
-        INT y0 = min(vecs[0].y, vecs[2].y);
-        INT x1 = max(vecs[0].x, vecs[2].x);
-        INT y1 = max(vecs[0].y, vecs[2].y);
+        INT x0, y0, x1, y1;
+        if (pts[0].x < pts[2].x)
+        {
+            x0 = pts[0].x;
+            x1 = pts[2].x;
+        }
+        else
+        {
+            x0 = pts[2].x;
+            x1 = pts[0].x;
+        }
+        if (pts[0].y < pts[2].y)
+        {
+            y0 = pts[0].y;
+            y1 = pts[2].y;
+        }
+        else
+        {
+            y0 = pts[2].y;
+            y1 = pts[0].y;
+        }
         if (dc->dctype == DCTYPE_DIRECT)
             MouseSafetyOnDrawStart(dc->ppdev, x0, y0, x1, y1);
     }
 
     if (plf->lfUnderline)
     {
+        INT i, nEscape = lfEscapement % (180 * 10);
         for (i = -thickness / 2; i < -thickness / 2 + thickness; ++i)
         {
-            LONG dx = (LONG)(DeltaX64 >> 6), dy = (LONG)(DeltaY64 >> 6);
-            if (labs(dx) > labs(dy))
+            if (nEscape < 45 * 10 || nEscape > (180 - 45) * 10)
             {
                 // move vertical
                 EngLineTo(SurfObj, (CLIPOBJ *)&dc->co,
                           &dc->eboText.BrushObject,
-                          vecs[5].x, vecs[5].y + i,
-                          vecs[6].x, vecs[6].y + i,
+                          pts[5].x, pts[5].y + i,
+                          pts[6].x, pts[6].y + i,
                           NULL, ROP2_TO_MIX(R2_COPYPEN));
             }
             else
@@ -6268,8 +6287,8 @@ IntExtTextOutW(
                 // move horizontal
                 EngLineTo(SurfObj, (CLIPOBJ *)&dc->co,
                           &dc->eboText.BrushObject,
-                          vecs[5].x + i, vecs[5].y,
-                          vecs[6].x + i, vecs[6].y,
+                          pts[5].x + i, pts[5].y,
+                          pts[6].x + i, pts[6].y,
                           NULL, ROP2_TO_MIX(R2_COPYPEN));
             }
         }
@@ -6277,16 +6296,16 @@ IntExtTextOutW(
 
     if (plf->lfStrikeOut)
     {
+        INT i, nEscape = lfEscapement % (180 * 10);
         for (i = -thickness / 2; i < -thickness / 2 + thickness; ++i)
         {
-            LONG dx = (LONG)(DeltaX64 >> 6), dy = (LONG)(DeltaY64 >> 6);
-            if (labs(dx) > labs(dy))
+            if (nEscape < 45 * 10 || nEscape > (180 - 45) * 10)
             {
                 // move vertical
                 EngLineTo(SurfObj, (CLIPOBJ *)&dc->co,
                           &dc->eboText.BrushObject,
-                          vecs[7].x, vecs[7].y + i,
-                          vecs[8].x, vecs[8].y + i,
+                          pts[7].x, pts[7].y + i,
+                          pts[8].x, pts[8].y + i,
                           NULL, ROP2_TO_MIX(R2_COPYPEN));
             }
             else
@@ -6294,9 +6313,10 @@ IntExtTextOutW(
                 // move horizontal
                 EngLineTo(SurfObj, (CLIPOBJ *)&dc->co,
                           &dc->eboText.BrushObject,
-                          vecs[7].x + i, vecs[7].y,
-                          vecs[8].x + i, vecs[8].y,
-                          NULL, ROP2_TO_MIX(R2_COPYPEN));
+                          pts[7].x + i, pts[7].y,
+                          pts[8].x + i, pts[8].y,
+                          NULL,
+                          ROP2_TO_MIX(R2_COPYPEN));
             }
         }
     }
@@ -6307,7 +6327,7 @@ IntExtTextOutW(
             MouseSafetyOnDrawEnd(dc->ppdev);
     }
 
-    if (pdcattr->flTextAlign & TA_UPDATECP) {
+    if (pdcattr->lTextAlign & TA_UPDATECP) {
         pdcattr->ptlCurrent.x = DestRect.right - dc->ptlDCOrig.x;
     }
 
diff --git a/win32ss/gdi/ntgdi/xformobj.c b/win32ss/gdi/ntgdi/xformobj.c
index 0d938df..adf0972 100644
--- a/win32ss/gdi/ntgdi/xformobj.c
+++ b/win32ss/gdi/ntgdi/xformobj.c
@@ -150,21 +150,12 @@ XFORMOBJ_iSetXform(
     IN const XFORML *pxform)
 {
     PMATRIX pmx = XFORMOBJ_pmx(pxo);
-    FLOATOBJ ef1, ef2, efTemp;
 
     /* Check parameters */
     if (!pxo || !pxform) return DDI_ERROR;
 
     /* Check if the xform is valid */
-    /* M11 * M22 - M12 * M21 != 0 */
-    FLOATOBJ_SetFloat(&ef1, pxform->eM11);
-    FLOATOBJ_SetFloat(&efTemp, pxform->eM22);
-    FLOATOBJ_Mul(&ef1, &efTemp);
-    FLOATOBJ_SetFloat(&ef2, pxform->eM12);
-    FLOATOBJ_SetFloat(&efTemp, pxform->eM21);
-    FLOATOBJ_Mul(&ef2, &efTemp);
-    if (FLOATOBJ_Equal(&ef1, &ef2))
-        return DDI_ERROR;
+    if ((pxform->eM11 == 0) || (pxform->eM22 == 0)) return DDI_ERROR;
 
     /* Copy members */
     FLOATOBJ_SetFloat(&pmx->efM11, pxform->eM11);
