[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] drawing outside a UserView broken?
- To: sc-users@xxxxxxxxxxxxxxxx
- Subject: Re: [sc-users] drawing outside a UserView broken?
- From: thelych@xxxxxxxxx
- Date: Fri, 19 Jun 2009 11:16:02 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=unWFlCb3aKWg3ocZmGwZzeY4OHB18pNCkURsFqrUs/M=; b=MH73cjLPSEDqTgoq9l4vq9qECTUDq5vUQm+ZznLgauBRhp4ttdlor2IMHApyCQ2Kl3 BjoaHUehUMu04s0C9CNPcL0ekzhltQgkPpgVgK+4lsxl5rqvvHoti7ztsgVVtCgIOddo VmMdZU5RtwjQvuyjuFwaPqvouoXQNO6F3ot3Y=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=eUk43Q4yOfp6lD+5ucueitTI5vDFv8xRweA+JC38xxNwiFokXPy/CWmw88vdX8NPqn u0bgtTmMZ6aaaCiVFE6rtPGacI4fyppWPAgH0P7QfS0/lky2ScOpKiikLWq6wcdOpD6R Tu402a64STAptKwNKiz55HruUSNidpGaOtE2c=
- In-reply-to: <993F0301-8DD5-4FC0-8241-0127A89DD187@xxxxxxxxxxxxxx>
- List-id: SuperCollider users mailing list <sc-users.create.ucsb.edu>
- References: <993F0301-8DD5-4FC0-8241-0127A89DD187@xxxxxxxxxxxxxx>
- Reply-to: sc-users@xxxxxxxxxxxxxxxx
- Sender: owner-sc-users@xxxxxxxxxxxxxxxx
hi wouter,
with relativeOrigin = true the UserView draws in a separate, and
constrained layer whose bounds are equal to the view bounds.
you cannot draw outside of it. It's like it clips the region.
there is no workaround.
I do not consider it as a bug. Actually i think drawing inside a view
should be constrained to its bounds.
since relativeOrigin will be / is deprecated, a *possible workaround*
would be to add a flag to disable this layer and allow to draw outside
of the view
but this possibility will be a kind of *hack* : meaning there is few
cases where those extended drawings won't be refreshed correctly,
probably leaving the window with dirty drawings inside.
that should be probably discussed in the dev-list before.
until then you have to use relativeOrigin = false to draw your custom
focus ring... wich i know may not stand in future releases.
best,
charles
Le 19 juin 09 à 10:40, Wouter Snoei a écrit :
Hi,
I'm trying to update my lib to reflect the deprication of
relativeOrigin, but stumbled across a problem: as soon as I set
relativeOrigin to false on a UserView, it doesn't draw outside its
borders anymore. This is problematic since I draw my own focus rings
around all my gui widgets. Even when I do a refreshInRect with the
correct bounds it still doesn't draw. Is this a bug or a feature?
And in any case; how to work around it?
(
w = Window().front;
w.addFlowLayout;
a = UserView( w, 100@100 ).relativeOrigin_(false)
.focusColor_( Color.clear )
.drawFunc_({ |vw|
var bounds = vw.bounds;
Pen.addRect( bounds.insetBy(-1,-1) );
Pen.line( bounds.leftTop, bounds.rightBottom );
Pen.line( bounds.rightTop, bounds.leftBottom );
Pen.stroke
});
b = UserView( w, 100@100 ).relativeOrigin_(true)
.focusColor_( Color.clear )
.drawFunc_({ |vw|
var bounds = vw.bounds.moveTo(0,0);
Pen.addRect( bounds.insetBy(-1,-1) ); // doesn't show!!
Pen.line( bounds.leftTop, bounds.rightBottom );
Pen.line( bounds.rightTop, bounds.leftBottom );
Pen.stroke
});
)
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/