You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been doing some custom painting, and I was having some performance problems. I'm in a situation where I know I only need to repaint a small area of my canvas, but the repaint! macro causes a full repaint of the whole canvas. I tried conspiring behind it's back to only repaint the region I know needs painting, but the rest of the canvas gets blanked out.
After searching the swing docs, it looks like the solution is to specify a dirty region to repaint, rather than repainting the whole component. There's no way to do this (as far as I can tell) in seesaw, the repaint! function always repaints whole components.
I can solve my problem (I think) by manually calling the swing repaint methods, but it would be nice if there was a seesaw way to do this.
The text was updated successfully, but these errors were encountered:
Here's the core of a method to do this. I'm too tired to make it work nicely with multiple widgets/rectangles right now.
Yes you have to deconstruct the rectangle like that because java.awt.component repaint methods won't take a java.awt.rectangle2D, only x y w h in the argument list. (I think it makes sense for the seesaw interface to take a seesaw.graphics/rect even though the underlying swing/awt code is dumb)
(defn repaint-region!
"Repaint only a specified rectangle"
[widget rect]
(.repaint (seesaw.core/to-widget widget)
(.getX rect)
(.getY rect)
(.getWidth rect)
(.getHeight rect)))
I've been doing some custom painting, and I was having some performance problems. I'm in a situation where I know I only need to repaint a small area of my canvas, but the repaint! macro causes a full repaint of the whole canvas. I tried conspiring behind it's back to only repaint the region I know needs painting, but the rest of the canvas gets blanked out.
After searching the swing docs, it looks like the solution is to specify a dirty region to repaint, rather than repainting the whole component. There's no way to do this (as far as I can tell) in seesaw, the repaint! function always repaints whole components.
I can solve my problem (I think) by manually calling the swing repaint methods, but it would be nice if there was a seesaw way to do this.
The text was updated successfully, but these errors were encountered: