[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] SwingOSC double refresh problem



hi wouter,

i have seen this from your code, however in this moment no clue where exactly the problem is. i put in the bug tracker and will examine closer when i have time. thanks for reporting! ciao, -sciss-

Am 26.07.2009 um 11:22 schrieb Wouter Snoei:

Hi,

I 'm trying some things with swingosc and get the same problem over and over again with different situations. It seems in some cases a window refresh causes the Pen functions to be rendered multiple times on top of each other. I get it with my RoundButton -> swingosc experiments, but also with simple drawHook functions. It seems to happen most often when a .clip and/or a .use is included in the drawHook.

GUI.swing;
w = Window().front;

(
w.drawHook = { |win|
	var rect;
	
	rect = win.asView.bounds;
	
	Pen.line( rect.leftBottom, rect.rightTop );
	Pen.line( rect.rightBottom, rect.leftTop );
	Pen.stroke;
	
	Pen.use({
		Pen.color = Color.blue(0.5).alpha_(0.5);
		Pen.addRect( rect.copy.width_( (rect.width * 0.5).floor ) );
		Pen.clip;
		Pen.addRect( rect );
		Pen.fill;
		});
		
		
	Pen.use({
		Pen.color = Color.blue(0.5).alpha_(0.5);
		Pen.addRect( rect.copy
				.width_( (rect.width * 0.5).floor )
				.moveBy( (rect.width * 0.5).floor, 0 ) );
		Pen.clip;
		Pen.addRect( rect );
		Pen.fill;
		});

	}; w.refresh;
)

now if I resize the window I see the blue rects flashing darker and lighter, indicating that they are layered on top of each other. They flash independent of each other, even though they are in the same drawHook. When I remove the Pen.clip; and Pen.addRect( rect ); lines it gets less. Also when I move the functions outside the Pen.use({ ... }) statements it gets less. But still it happens sometimes. It also happens with functions inside UserViews, especially when clicking another userview in the same window.

I use OSX 10.5.7 & SwingOSC 0.62 (recent build with fillAxialGradient)

cheers,
Wouter


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/ sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/