Corrections... use a <rect> instead of a <g> for the glasspane and ensure it covers the entire svg/viewBox
sorry for the confusion On Tue, Sep 8, 2009 at 1:47 PM, jonathan wood <[email protected]>wrote: > Hi Shekhar, > > If I understand correctly, you have 1 (or more) elements on the canvas > and you would like to highlight the clicked one and unhighlight when the > background is clicked. The below assumes that... > > One method is to add a "glass pane" to the canvas in order to capture the > "off" events. > > Add a <g> behind all other elements. > ensure that the <g> tag pointer-events="all" or other (see > http://www.w3.org/TR/SVG/interact.html#PointerEventsProperty) > Add a listener for the <g> > > you'll have to manage the event bubbling with this method, but it is pretty > easy to implement > > > Hope this helps, > > > Jonathan > > > On Tue, Sep 8, 2009 at 9:02 AM, Shekhar Bhati <[email protected]>wrote: > >> Can anyone suggest something regarding below mentioned issue with batik? >> >> Thanks, >> Shekhar >> >> >> ---------- Forwarded message ---------- >> From: Shekhar Bhati <[email protected]> >> Date: Fri, Sep 4, 2009 at 6:46 PM >> Subject: Issue in setting the canvas size( Mouse click not active in >> whole area of the applet) >> To: [email protected] >> >> >> Hi Batik experts, >> >> I am using Batik in visualizing my application images. >> >> I have a functionality of highlighting/unhighlighting objects ,which >> is when I click on a particular object(image) , it gets highlighted >> and if I click anywhere else on the frame(applet) it should get >> unhighlighted. >> >> The issue is when an object is highlighted then only between a fix >> area only the unhighlighting is working. >> Even when i try to track the mouse click action then also it is not >> able to sense the click event beside that particular area.. >> >> Is it the problem of canvas size? >> >> How can I enable my mouse click event all over the applet? >> >> Thanks & regards, >> >> Shekhar >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [email protected] >> For additional commands, e-mail: [email protected] >> >> >
