jdk/src/windows/classes/sun/awt/windows/WPathGraphics.java
changeset 21929 48575f27a3cb
parent 21278 ef8a3a2a72f2
child 22584 eed64ee05369
child 23272 0e0103e73d3c
equal deleted inserted replaced
21781:12385ca90f4d 21929:48575f27a3cb
   568          */
   568          */
   569         if ((gv.getLayoutFlags() & GlyphVector.FLAG_HAS_TRANSFORMS) != 0) {
   569         if ((gv.getLayoutFlags() & GlyphVector.FLAG_HAS_TRANSFORMS) != 0) {
   570             return false;
   570             return false;
   571         }
   571         }
   572 
   572 
       
   573         if (gv.getNumGlyphs() == 0) {
       
   574             return true; // nothing to do.
       
   575         }
       
   576 
   573         AffineTransform deviceTransform = getTransform();
   577         AffineTransform deviceTransform = getTransform();
   574         AffineTransform fontTransform = new AffineTransform(deviceTransform);
   578         AffineTransform fontTransform = new AffineTransform(deviceTransform);
   575         Font font = gv.getFont();
   579         Font font = gv.getFont();
   576         fontTransform.concatenate(font.getTransform());
   580         fontTransform.concatenate(font.getTransform());
   577         int transformType = fontTransform.getType();
   581         int transformType = fontTransform.getType();
   597         }
   601         }
   598         /* Compute the starting position of the string in
   602         /* Compute the starting position of the string in
   599          * device space.
   603          * device space.
   600          */
   604          */
   601         Point2D.Float userpos = new Point2D.Float(x, y);
   605         Point2D.Float userpos = new Point2D.Float(x, y);
       
   606         /* Add the position of the first glyph - its not always 0,0 */
       
   607         Point2D g0pos = gv.getGlyphPosition(0);
       
   608         userpos.x += (float)g0pos.getX();
       
   609         userpos.y += (float)g0pos.getY();
   602         Point2D.Float devpos = new Point2D.Float();
   610         Point2D.Float devpos = new Point2D.Float();
   603 
   611 
   604         /* Already have the translate from the deviceTransform,
   612         /* Already have the translate from the deviceTransform,
   605          * but the font may have a translation component too.
   613          * but the font may have a translation component too.
   606          */
   614          */