i tried what thomas suggested and it worked but its still cpu intensive.. how can i make dragging an element more efficient? i read that i can use overlays but when i looked at the cpu usage, its almost the same as updating the dom... any suggestions?
thomas.deweese wrote: > > Hi Michael, JavaNoob, > > "Bishop, Michael W. CONTR J9C880" <[EMAIL PROTECTED]> wrote on > 07/07/2008 10:21:41 AM: > >> In your Overlay's paint method, clear the rectangle first. >> >> g2d.clearRect(0, 0, width, height); > > This might work but it might also simply erase the > entire canvas. I would suggest changing to: > >> > @Override >> > public void mouseDragged(MouseEvent e) { >> > x = e.getX(); >> > y = e.getY(); >> > JGVTComponent c = (JGVTComponent) e.getSource(); > c.immediateRepaint(); >> > } > > This will trigger the overlay to be painted. > > -- View this message in context: http://www.nabble.com/Select-an-element-and-draw-it-on-the-canvas-without-updating-the-svg-tp18189565p18426935.html Sent from the Batik - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]