From a8c615cc33b289a95ce861d3c3168f4a86451c12 Mon Sep 17 00:00:00 2001 From: nrp Date: Tue, 20 Jan 2009 05:24:11 +0000 Subject: added pressure sensitivity --- diff --git a/colors.py b/colors.py index e1ceb4d..06899d1 100755 --- a/colors.py +++ b/colors.py @@ -1737,11 +1737,13 @@ class Colors(activity.Activity, ExportedGObject): camcomponent = cammask.connected_component() camcount = camcomponent.count() # make sure its not just noise - if camcount > 1500: + if camcount > 1000: campos = camcomponent.centroid() size = self.window.get_size() self.lastmx = self.mx self.lastmy = self.my + self.lastr = self.pressure + self.pressure = int(min(255,camcount/20)) # scale and adjust it so the borders can still be reached self.mx = int(25+max(0.0, min(1.0, (campos[0]*1.2-16)/160.0))*(size[0]-50)) self.my = int(25+max(0.0, min(1.0, (campos[1]*1.2-12)/120.0))*(size[1]-50)) -- cgit v0.9.1