hi,
  Sorry for the last message "coordinate transformation problem?" -- I
think I made a mistake in running an older version, not the one from
CVS.  It appears to be working with the current CVS version.

-Randy


-------previous message----------
hi,
  I had a problem which I was happy to see go away in 1.5.1rc2, but in
the latest version of CVS it appears to be back (maybe this email should
go to the developer's mailing list instead?).  A brief, but hopefully
adequate description of the problem:
  On a single JSVGCanvas two blocks of text are displayed, each in it's
own SVG element; i.e. the doc looks like: <svg...>
   <svg> ...first block of text elements
   </svg>
   <svg> ...second block of text elements
   </svg>
</svg> 

  When the user clicks on a character in the first block, the character
is highlighted.  When the user clicks on a character in the second block
(nearly the same as the first but with a y offset), the highlight
appears at the the beginning of the line of text rather than at the
correct location.  Some of the relevant code looks like:

    /** Returns a small rectangle enlosing the character that was
clicked on.
     *
     * @param evt  The event, which contains the Element clicked on.
     * @return
     */
    private Element selectText(Event evt) {
              MouseEvent mevt = (MouseEvent) evt;
              SVGElement targ = (SVGElement) mevt.getTarget();
              SVGOMTextElement texttarg = (SVGOMTextElement) targ;
              // Try to get character under the position where the mouse
was clicked.
              SVGOMPoint spoint;
              SVGPoint spointInv;
              int mx, my;
              // Get mouse click coordinates
              mx = mevt.getClientX();
              my = mevt.getClientY();
              spoint = new SVGOMPoint(mx, my);
              SVGMatrix svgMatrix = texttarg.getScreenCTM();
              SVGMatrix invMat = svgMatrix.inverse();
              spointInv = spoint.matrixTransform(invMat);
              // Get the segment start position based on the fact that a
text
                  // element for a line of sequence has an id attribute
                  // like: id="SegStart_15812401"
              long unAdjustedPos;
              unAdjustedPos = texttarg.getCharNumAtPosition(spointInv);
              return getSVGFormatter().svg_HiLightChar("Region
Endpoint", texttarg, unAdjustedPos, "green");
    }

   Does anyone have an idea what might be going on?

-Randy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to