Error processing request

Parameters

CONTENT_LENGTH0
REQUEST_METHODGET
REQUEST_URI/revision/Kinetic+scrolling?V=4
QUERY_STRINGV=4
CONTENT_TYPE
DOCUMENT_URI/revision/Kinetic+scrolling
DOCUMENT_ROOT/var/www/nikit/nikit/nginx/../docroot
SCGI1
SERVER_PROTOCOLHTTP/1.1
REMOTE_ADDR172.70.130.89
REMOTE_PORT58494
SERVER_PORT8888
SERVER_NAMEwiki.tcl-lang.org
HTTP_HOSTwiki.tcl-lang.org
HTTP_CONNECTIONKeep-Alive
HTTP_ACCEPT_ENCODINGgzip
HTTP_X_FORWARDED_FOR18.119.138.123
HTTP_CF_RAY884b7625abc42d52-ORD
HTTP_X_FORWARDED_PROTOhttp
HTTP_CF_VISITOR{"scheme":"http"}
HTTP_ACCEPT*/*
HTTP_USER_AGENTMozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; [email protected])
HTTP_CF_CONNECTING_IP18.119.138.123
HTTP_CDN_LOOPcloudflare
HTTP_CF_IPCOUNTRYUS

Body


Error

Unknow state transition: LINE -> END

-code

1

-level

0

-errorstack

INNER {returnImm {Unknow state transition: LINE -> END} {}} CALL {my render_wikit {Kinetic scrolling} \[ABU\]\ 1-oct-2011\n\nThis\ is\ a\ small\ experiment\ trying\ to\ add\ a\ kinetic\ behavior\ to\ some\ dragged\ objects.\n\nYou\ can\ click\ and\ drag\ one\ of\ the\ boxes\ in\ the\ main\ window\ and\ then,\ when\ you\ release\ the\ mouse\ button,\ the\ dragged\ object\ will\ continue\ its\ path\ with\ a\ progressively\ decreasing\ speed.\n\n\[Image\ slidingboxes\]\n\nYou\ can\ experiment\ this\ kinetic\ scrolling\ by\ changing\ the\ friction\ coefficient.\n\nNote\ that,\ though\ \ it's\ trivial\ to\ get\ the\ mouse\ position,\ it's\ very\ hard\ to\ get\ the\ninstantaneous\ mouse\ speed\ (this\ is\ a\ key\ factor\ for\ setting\ a\ 'good'\ motion\ equation).\nFor\ this\ reason,\ there\ are\ two\ sliders\ controlling\ the\ min\ and\ max\ speeed.\n\nWhen\ you\ release\ the\ mouse\ button\ after\ dragging,\ the\ instantaneous\ mouse\ speed\ is\ recorded\ and\ used\ for\ setting\ the\ kinetic\ effect.\n\nNo\ scrolling\ is\ performed\ if\ speed\ is\ too\ low\ (it\ will\ be\ unnoticeable)\ and,\nsince\ mouse\ movements\ can\ be\ very\ fast\ (>4000pixel/sec),\ speed\ is\ limited\ to\ a\ speed-limit.\n\n----\n\nCode\ is\ really\ simplified\ in\ order\ to\ highlight\ the\ basic\ principle.\nObjects\ are\ here\ implemented\ as\ rectangle-items\ in\ a\ canvas\ widget\ but\ it's\ not\ difficult\ to\ \nabstract\ and\ implement\ them\ with\ other\ kinds\ of\ widgets.\nNote\ that\ the\ scrolling\ is\ performed\ as\ a\ chain\ of\ async\ callbacks,\ without\ blocking\ the\ main\ processing\ thread\n\n----\n\nFor\ those\ interested\ with\ math,\ when\ you\ release\ the\ mouse\ button\ after\ dragging\ an\ object,\nan\ opposite\ force\ proportional\ to\ the\ speed\ is\ applied.\ \n\ \ \ a(t)\ =\ -k*v(t)\n\ \ \ \ \ \ a(t)\ acceleration\ \ (t=0\ is\ when\ you\ relase\ the\ mouse-button)\n\ \ \ \ \ \ k\ is\ a\ friction\ coefficient\ (k=0\ means\ no\ friction\ at\ all)\nBy\ integrating\ this\ equation\ you\ can\ get\ a\ formula\ for\ the\ speed\ \ v(t)\ and\nfor\ the\ position\ p(t)\ (\ or\ better\ the\ displacement\ after\ t=0\ )\n\ \ \ v(t)\ =\ v(0)*exp(-k*t)\n\ \ \ p(t)=v(0)/k*(1-exp(k*t))\ \ (\ we\ assume\ p(0)=0\ )\n\nNote\ that\ speed\ never\ reaches\ zero\ and\ position\ (displacement)\ tends\ to\ v(0)/k.\n\nhere\ is\ the\ code:\n\n\n======\n\ #\ Inertial\ Scrolling\n\n\ #\ A\ small\ experiment\ on\ inertial\ movement\n\ #\ Drag\ the\ box\ and\ let\ it\ scroll\ ..\n\n\ \ #\ --------------------------------------------------------------------------\n\ \ #\ parameters\;\ fell\ free\ to\ change\ them\ (or\ use\ slide\ controls)\n\ \ #\ WARNING:\ must\ be\ real\ numbers,\ not\ integers\n\ \ #\ --------------------------------------------------------------------------\n\ set\ ANIM(K)\ \ \ \ 4.5\ \ \ \ \;\ #\ friction\n\ set\ ANIM(VMIN)\ 50.0\ \ \ \;\ #\ Velocity\ min\ -\ (pixel/sec)\n\ set\ ANIM(VMAX)\ 1000.0\ \;\ #\ Velocity\ max\ -\ (pixel/sec)\n\n\ \ #\ --------------------------------------------------------------------------\n\ \ #\ prepare\ a\ canvas\ with\ two\ boxes\n\ \ #\ plus\ some\ parameters'\ controls\n\ \ #\ --------------------------------------------------------------------------\n\ label\ .msg\ -text\ \"Drag\ the\ boxes\ and\ let\ them\ scroll...\\nClick\ on\ canvas\ to\ stop\ them\"\n\ pack\ .msg\n\ canvas\ .c\ -bg\ gray\ -bd\ 2\ -relief\ sunken\n\ pack\ .c\ -expand\ 1\ -fill\ both\ -padx\ 10\ -pady\ 10\n\n\ #\ a\ probe\ for\ dragging\ speed\n\ scale\ .speed\ -orient\ horizontal\ -variable\ V\ -label\ \"Detected\ Speed\"\ \\\n\ \ \ \ -from\ 0\ -to\ 4000\ -state\ disabled\ -relief\ flat\n\ pack\ .speed\ -fill\ x\ \n\n\n\ \ #\ note\ max\ and\ min\ values\ are\ just\ a\ suggestion\n\ frame\ .s\ \ \n\ scale\ .s.s1\ -orient\ horizontal\ -variable\ ANIM(K)\ -label\ \"Friction\"\ \\\n\ \ \ \ -from\ 1.0\ -to\ 12.0\ \ -resolution\ 0.1\n\ scale\ .s.s2\ -orient\ horizontal\ -variable\ ANIM(VMIN)\ -label\ \"Min\ speed\"\ \\\n\ \ \ \ -from\ 10\ \ -to\ 100\ \ -resolution\ 0.1\n\ scale\ .s.s3\ -orient\ horizontal\ -variable\ ANIM(VMAX)\ -label\ \"Max\ speed\"\ \\\n\ \ \ \ -from\ 100\ -to\ 2000\ \ -resolution\ 0.1\ \n\ pack\ \{*\}\[winfo\ children\ .s\]\ -side\ left\ -fill\ x\ -expand\ 1\n\ pack\ .s\ -fill\ x\n\n\ .c\ create\ rectangle\ 0\ 0\ 200\ 150\ -fill\ orange\ -tags\ slidingBox\n\ .c\ create\ rectangle\ 130\ 100\ 500\ 300\ -fill\ yellow\ -tags\ slidingBox\n\n\ #\ =============================================================================\n\n\ \ #\ return\ current\ time\ in\ *seconds*\ as\ a\ decimal\ number\ \n\ \ #\ with\ the\ highest\ precision\ (microseconds)\n\ proc\ now\ \{\}\ \{\ expr\ \[clock\ microseconds\]/1E6\ \}\n\n\n\ .c\ bind\ slidingBox\ <ButtonPress-1>\ \{\n\ \ \ \ global\ MOUSE\n\ \ \ \ set\ w\ %W\n\ \ \ \ set\ MOUSE(X)\ %x\n\ \ \ \ set\ MOUSE(Y)\ %y\n\ \ \ \ set\ MOUSE(T)\ \[now\]\n\ \ \ \ set\ MOUSE(VX)\ 0.0\n\ \ \ \ set\ MOUSE(VY)\ 0.0\n\ \ \ \ \n\ \ \ \ \$w\ raise\ current\n\ \}\n\n\n\ .c\ bind\ slidingBox\ <B1-Motion>\ \{\n\ \ \ \ global\ MOUSE\n\ \ \ \ \n\ \ \ \ set\ w\ %W\n\ \ \ \ set\ x\ %x\n\ \ \ \ set\ y\ %y\n\ \ \ \ set\ t\ \[now\]\n\ \ \ \ \n\ \ \ \ set\ dx\ \[expr\ \{\$x-\$MOUSE(X)\}\]\n\ \ \ \ set\ dy\ \[expr\ \{\$y-\$MOUSE(Y)\}\]\n\ \ \ \ set\ dt\ \[expr\ \{\$t-\$MOUSE(T)\}\]\n\ \ \ \ \ \ \ \ \ \ \ \ \n\ \ \ \ set\ MOUSE(X)\ \$x\n\ \ \ \ set\ MOUSE(Y)\ \$y\ \n\ \ \ \ set\ MOUSE(T)\ \$t\n\ \ \ \ set\ MOUSE(VX)\ \[expr\ double(\$dx)/\$dt\]\n\ \ \ \ set\ MOUSE(VY)\ \[expr\ double(\$dy)/\$dt\]\n\ \ \ \ \ set\ ::V\ \[expr\ \{hypot(\$MOUSE(VX),\$MOUSE(VY))\}\]\ \;\ #\ just\ a\ probe\ for\ display\ \ \ \ \n\ \ \ \ \n\ \ \ \ \$w\ move\ current\ \$dx\ \$dy\n\ \}\n\n\n\ \ \ \ #\ when\ you\ release\ mouse\ button,\ target\ should\ keep\ on\ moving,\ \n\ \ \ \ #\ with\ an\ initial\ speed\ depending\ on\ the\ 'last'\ speed\ and\ the\ time\ spent\ \n\ \ \ \ #\ from\ the\ last\ movement\ \n\ .c\ bind\ slidingBox\ <ButtonRelease-1>\ \{\n\ \ \ \ global\ MOUSE\n\ \ \ \ global\ ANIM\n\n\ \ \ \ set\ w\ %W\n\ \ \n\ \ \ \ set\ dt\ \[expr\ \{\[now\]-\$MOUSE(T)\}\]\ \ \n\ \ \ \ set\ DECEL\ \[expr\ \{exp(-\$ANIM(K)*\$dt)\}\]\n\ \ \ \ set\ vx\ \[expr\ \{\$MOUSE(VX)\ *\ \$DECEL\}\]\n\ \ \ \ set\ vy\ \[expr\ \{\$MOUSE(VY)\ *\ \$DECEL\}\]\n\ \ \ \ \n\ \ \ \ \ #\ if\ speed\ magnitude\ is\ too\ low,\ it's\ useless\ to\ continue\ !\n\ \ \ \ set\ vLen\ \[expr\ \{hypot(\$vx,\$vy)\}\]\ \ \n\ \ \ \ \ set\ ::V\ \$vLen\ \;\ #\ just\ a\ probe\ for\ display\ \ \n\ \ \ \ if\ \{\ \$vLen\ <\ \$ANIM(VMIN)\ \}\ return\n\ \ \ \ \n\ \ \ \ \ #\ if\ speed\ is\ too\ high,\ limit\ it\n\ \ \ \ if\ \{\ \$vLen\ >\ \$ANIM(VMAX)\ \}\ \{\n\ \ \ \ \ \ \ \ \ #\ reduce\ vLen\ to\ ANIM(VMAX)\n\ \ \ \ \ \ \ \ set\ a\ \[expr\ \{\$vLen\ /\ \$ANIM(VMAX)\}\]\n\ \ \ \ \ \ \ \ set\ vx\ \[expr\ \{\$vx/\$a\}\]\n\ \ \ \ \ \ \ \ set\ vy\ \[expr\ \{\$vy/\$a\}\]\n\ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ set\ vLen\ \[expr\ double(\$ANIM(VMAX))\]\n\ \ \ \ \}\n\ \ \ \ \n\ \ \ \ \ #\ since\ speed\ zero\ won't\ be\ never\ reached,\n\ \ \ \ \ #\ \ compute\ time\ to\ reach\ speed\ VMIN\n\ \ \ \ set\ a\ \[expr\ \{\$ANIM(VMIN)\ /\ \$vLen\}\]\n\ \ \ \ set\ duration\ \[expr\ \{log(1/\$a)/\$ANIM(K)\}\]\n\ \ \ \ \ #\ then\ compute\ the\ position\ (displacement)\ we\ will\ reach\ in\ \$duration\n\ \ \ \ set\ DX\ \[expr\ \{\$vx/\$ANIM(K)*(\ 1-\$a\ )\}\]\n\ \ \ \ set\ DY\ \[expr\ \{\$vy/\$ANIM(K)*(\ 1-\$a\ )\}\]\n\n\ \ \ \ \n\ \ \ \ set\ id\ \ \[\$w\ find\ withtag\ current\]\n\ \ \ \ lassign\ \[\$w\ coords\ \$id\]\ X0\ Y0\n\ \ \ \ \ #\ move\ object\ from\ (X0,Y0)\ to\ (X0+DX,Y0+DY)\ \ within\ time-interval\ (now,\ now+duration)\n\ \ \ \ _KEEPONMOVING\ \[list\ \$w\ \$id\]\ \$X0\ \$Y0\ \$DX\ \$DY\ \[now\]\ \$duration\n\ \}\n\n\n\ \ #\ when\ you\ click,\ stop\ all\ moving\ objects\ \n\ bind\ .c\ <ButtonPress-1>\ \{\n\ \ \ \ global\ ANIM\n\ \ \ \ foreach\ \{key\ val\}\ \[array\ get\ ANIM\ ID,*\]\ \{\n\ \ \ \ \ \ \ \ after\ cancel\ \$val\n\ \ \ \ \ \ \ \ array\ unset\ ANIM\ \$key\n\ \ \ \ \}\n\ \}\n\n\n\ proc\ _KEEPONMOVING\ \{objID\ X0\ Y0\ DX\ DY\ T0\ DT\}\ \{\n\ \ \ \ global\ ANIM\n\ \ \ \ lassign\ \$objID\ w\ id\n\ \ \ \ \n\ \ \ \ set\ t\ \[expr\ (\[now\]-\$T0)/\$DT\]\n\ \ \ \ if\ \{\ \$t\ >\ 1.0\ \}\ \{\ set\ t\ 1.0\ \}\n\ \ \ \ #\ ----\ easing\ transformation\ -----\n\ \ \ \ \ #\ set\ tt\ \[expr\ \{1-exp(-\$ANIM(K)*\$t)\}\]\n\ \ \ \ set\ tt\ \[expr\ \{1-exp(-\$ANIM(K)*\$t*\$DT)\}\]\n\ \ \ \ #\ -\ -\ -\ -\ -\ -\ \n\ \ \ \ set\ px\ \[expr\ \{\$X0+\$tt*\$DX\}\]\n\ \ \ \ set\ py\ \[expr\ \{\$Y0+\$tt*\$DY\}\]\n\ \ \ \ \n\ \ \ \ _MOVE_TO\ \$w\ \$id\ \$px\ \$py\n\ \ \ \ if\ \{\ \$t\ <\ 1.0\ \}\ \{\ \ \ \ \ \ \n\ \ \ \ \ \ \ \ set\ ANIM(ID,\$objID)\ \[after\ 40\ \ \[list\ _KEEPONMOVING\ \$objID\ \$X0\ \$Y0\ \$DX\ \$DY\ \$T0\ \$DT\]\]\n\ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ #\ end\ of\ animation,\ unset\ unused\ memory\n\ \ \ \ \ \ \ \ array\ unset\ ANIM\ ID,\$objID\n\ \ \ \ \}\n\ \}\n\n\n\ proc\ _MOVE_TO\ \{w\ id\ x\ y\}\ \{\ \ \n\ \ lassign\ \[\$w\ coords\ \$id\]\ x0\ y0\n\ \ \$w\ move\ \$id\ \[expr\ \$x-\$x0\]\ \[expr\ \$y-\$y0\]\n\ \}\n======\n\n\[Ro\]:\ Very\ cool.\ Enjoyable!\n\n======\n\n<<categories>>\ GUI regexp2} CALL {my render {Kinetic scrolling} \[ABU\]\ 1-oct-2011\n\nThis\ is\ a\ small\ experiment\ trying\ to\ add\ a\ kinetic\ behavior\ to\ some\ dragged\ objects.\n\nYou\ can\ click\ and\ drag\ one\ of\ the\ boxes\ in\ the\ main\ window\ and\ then,\ when\ you\ release\ the\ mouse\ button,\ the\ dragged\ object\ will\ continue\ its\ path\ with\ a\ progressively\ decreasing\ speed.\n\n\[Image\ slidingboxes\]\n\nYou\ can\ experiment\ this\ kinetic\ scrolling\ by\ changing\ the\ friction\ coefficient.\n\nNote\ that,\ though\ \ it's\ trivial\ to\ get\ the\ mouse\ position,\ it's\ very\ hard\ to\ get\ the\ninstantaneous\ mouse\ speed\ (this\ is\ a\ key\ factor\ for\ setting\ a\ 'good'\ motion\ equation).\nFor\ this\ reason,\ there\ are\ two\ sliders\ controlling\ the\ min\ and\ max\ speeed.\n\nWhen\ you\ release\ the\ mouse\ button\ after\ dragging,\ the\ instantaneous\ mouse\ speed\ is\ recorded\ and\ used\ for\ setting\ the\ kinetic\ effect.\n\nNo\ scrolling\ is\ performed\ if\ speed\ is\ too\ low\ (it\ will\ be\ unnoticeable)\ and,\nsince\ mouse\ movements\ can\ be\ very\ fast\ (>4000pixel/sec),\ speed\ is\ limited\ to\ a\ speed-limit.\n\n----\n\nCode\ is\ really\ simplified\ in\ order\ to\ highlight\ the\ basic\ principle.\nObjects\ are\ here\ implemented\ as\ rectangle-items\ in\ a\ canvas\ widget\ but\ it's\ not\ difficult\ to\ \nabstract\ and\ implement\ them\ with\ other\ kinds\ of\ widgets.\nNote\ that\ the\ scrolling\ is\ performed\ as\ a\ chain\ of\ async\ callbacks,\ without\ blocking\ the\ main\ processing\ thread\n\n----\n\nFor\ those\ interested\ with\ math,\ when\ you\ release\ the\ mouse\ button\ after\ dragging\ an\ object,\nan\ opposite\ force\ proportional\ to\ the\ speed\ is\ applied.\ \n\ \ \ a(t)\ =\ -k*v(t)\n\ \ \ \ \ \ a(t)\ acceleration\ \ (t=0\ is\ when\ you\ relase\ the\ mouse-button)\n\ \ \ \ \ \ k\ is\ a\ friction\ coefficient\ (k=0\ means\ no\ friction\ at\ all)\nBy\ integrating\ this\ equation\ you\ can\ get\ a\ formula\ for\ the\ speed\ \ v(t)\ and\nfor\ the\ position\ p(t)\ (\ or\ better\ the\ displacement\ after\ t=0\ )\n\ \ \ v(t)\ =\ v(0)*exp(-k*t)\n\ \ \ p(t)=v(0)/k*(1-exp(k*t))\ \ (\ we\ assume\ p(0)=0\ )\n\nNote\ that\ speed\ never\ reaches\ zero\ and\ position\ (displacement)\ tends\ to\ v(0)/k.\n\nhere\ is\ the\ code:\n\n\n======\n\ #\ Inertial\ Scrolling\n\n\ #\ A\ small\ experiment\ on\ inertial\ movement\n\ #\ Drag\ the\ box\ and\ let\ it\ scroll\ ..\n\n\ \ #\ --------------------------------------------------------------------------\n\ \ #\ parameters\;\ fell\ free\ to\ change\ them\ (or\ use\ slide\ controls)\n\ \ #\ WARNING:\ must\ be\ real\ numbers,\ not\ integers\n\ \ #\ --------------------------------------------------------------------------\n\ set\ ANIM(K)\ \ \ \ 4.5\ \ \ \ \;\ #\ friction\n\ set\ ANIM(VMIN)\ 50.0\ \ \ \;\ #\ Velocity\ min\ -\ (pixel/sec)\n\ set\ ANIM(VMAX)\ 1000.0\ \;\ #\ Velocity\ max\ -\ (pixel/sec)\n\n\ \ #\ --------------------------------------------------------------------------\n\ \ #\ prepare\ a\ canvas\ with\ two\ boxes\n\ \ #\ plus\ some\ parameters'\ controls\n\ \ #\ --------------------------------------------------------------------------\n\ label\ .msg\ -text\ \"Drag\ the\ boxes\ and\ let\ them\ scroll...\\nClick\ on\ canvas\ to\ stop\ them\"\n\ pack\ .msg\n\ canvas\ .c\ -bg\ gray\ -bd\ 2\ -relief\ sunken\n\ pack\ .c\ -expand\ 1\ -fill\ both\ -padx\ 10\ -pady\ 10\n\n\ #\ a\ probe\ for\ dragging\ speed\n\ scale\ .speed\ -orient\ horizontal\ -variable\ V\ -label\ \"Detected\ Speed\"\ \\\n\ \ \ \ -from\ 0\ -to\ 4000\ -state\ disabled\ -relief\ flat\n\ pack\ .speed\ -fill\ x\ \n\n\n\ \ #\ note\ max\ and\ min\ values\ are\ just\ a\ suggestion\n\ frame\ .s\ \ \n\ scale\ .s.s1\ -orient\ horizontal\ -variable\ ANIM(K)\ -label\ \"Friction\"\ \\\n\ \ \ \ -from\ 1.0\ -to\ 12.0\ \ -resolution\ 0.1\n\ scale\ .s.s2\ -orient\ horizontal\ -variable\ ANIM(VMIN)\ -label\ \"Min\ speed\"\ \\\n\ \ \ \ -from\ 10\ \ -to\ 100\ \ -resolution\ 0.1\n\ scale\ .s.s3\ -orient\ horizontal\ -variable\ ANIM(VMAX)\ -label\ \"Max\ speed\"\ \\\n\ \ \ \ -from\ 100\ -to\ 2000\ \ -resolution\ 0.1\ \n\ pack\ \{*\}\[winfo\ children\ .s\]\ -side\ left\ -fill\ x\ -expand\ 1\n\ pack\ .s\ -fill\ x\n\n\ .c\ create\ rectangle\ 0\ 0\ 200\ 150\ -fill\ orange\ -tags\ slidingBox\n\ .c\ create\ rectangle\ 130\ 100\ 500\ 300\ -fill\ yellow\ -tags\ slidingBox\n\n\ #\ =============================================================================\n\n\ \ #\ return\ current\ time\ in\ *seconds*\ as\ a\ decimal\ number\ \n\ \ #\ with\ the\ highest\ precision\ (microseconds)\n\ proc\ now\ \{\}\ \{\ expr\ \[clock\ microseconds\]/1E6\ \}\n\n\n\ .c\ bind\ slidingBox\ <ButtonPress-1>\ \{\n\ \ \ \ global\ MOUSE\n\ \ \ \ set\ w\ %W\n\ \ \ \ set\ MOUSE(X)\ %x\n\ \ \ \ set\ MOUSE(Y)\ %y\n\ \ \ \ set\ MOUSE(T)\ \[now\]\n\ \ \ \ set\ MOUSE(VX)\ 0.0\n\ \ \ \ set\ MOUSE(VY)\ 0.0\n\ \ \ \ \n\ \ \ \ \$w\ raise\ current\n\ \}\n\n\n\ .c\ bind\ slidingBox\ <B1-Motion>\ \{\n\ \ \ \ global\ MOUSE\n\ \ \ \ \n\ \ \ \ set\ w\ %W\n\ \ \ \ set\ x\ %x\n\ \ \ \ set\ y\ %y\n\ \ \ \ set\ t\ \[now\]\n\ \ \ \ \n\ \ \ \ set\ dx\ \[expr\ \{\$x-\$MOUSE(X)\}\]\n\ \ \ \ set\ dy\ \[expr\ \{\$y-\$MOUSE(Y)\}\]\n\ \ \ \ set\ dt\ \[expr\ \{\$t-\$MOUSE(T)\}\]\n\ \ \ \ \ \ \ \ \ \ \ \ \n\ \ \ \ set\ MOUSE(X)\ \$x\n\ \ \ \ set\ MOUSE(Y)\ \$y\ \n\ \ \ \ set\ MOUSE(T)\ \$t\n\ \ \ \ set\ MOUSE(VX)\ \[expr\ double(\$dx)/\$dt\]\n\ \ \ \ set\ MOUSE(VY)\ \[expr\ double(\$dy)/\$dt\]\n\ \ \ \ \ set\ ::V\ \[expr\ \{hypot(\$MOUSE(VX),\$MOUSE(VY))\}\]\ \;\ #\ just\ a\ probe\ for\ display\ \ \ \ \n\ \ \ \ \n\ \ \ \ \$w\ move\ current\ \$dx\ \$dy\n\ \}\n\n\n\ \ \ \ #\ when\ you\ release\ mouse\ button,\ target\ should\ keep\ on\ moving,\ \n\ \ \ \ #\ with\ an\ initial\ speed\ depending\ on\ the\ 'last'\ speed\ and\ the\ time\ spent\ \n\ \ \ \ #\ from\ the\ last\ movement\ \n\ .c\ bind\ slidingBox\ <ButtonRelease-1>\ \{\n\ \ \ \ global\ MOUSE\n\ \ \ \ global\ ANIM\n\n\ \ \ \ set\ w\ %W\n\ \ \n\ \ \ \ set\ dt\ \[expr\ \{\[now\]-\$MOUSE(T)\}\]\ \ \n\ \ \ \ set\ DECEL\ \[expr\ \{exp(-\$ANIM(K)*\$dt)\}\]\n\ \ \ \ set\ vx\ \[expr\ \{\$MOUSE(VX)\ *\ \$DECEL\}\]\n\ \ \ \ set\ vy\ \[expr\ \{\$MOUSE(VY)\ *\ \$DECEL\}\]\n\ \ \ \ \n\ \ \ \ \ #\ if\ speed\ magnitude\ is\ too\ low,\ it's\ useless\ to\ continue\ !\n\ \ \ \ set\ vLen\ \[expr\ \{hypot(\$vx,\$vy)\}\]\ \ \n\ \ \ \ \ set\ ::V\ \$vLen\ \;\ #\ just\ a\ probe\ for\ display\ \ \n\ \ \ \ if\ \{\ \$vLen\ <\ \$ANIM(VMIN)\ \}\ return\n\ \ \ \ \n\ \ \ \ \ #\ if\ speed\ is\ too\ high,\ limit\ it\n\ \ \ \ if\ \{\ \$vLen\ >\ \$ANIM(VMAX)\ \}\ \{\n\ \ \ \ \ \ \ \ \ #\ reduce\ vLen\ to\ ANIM(VMAX)\n\ \ \ \ \ \ \ \ set\ a\ \[expr\ \{\$vLen\ /\ \$ANIM(VMAX)\}\]\n\ \ \ \ \ \ \ \ set\ vx\ \[expr\ \{\$vx/\$a\}\]\n\ \ \ \ \ \ \ \ set\ vy\ \[expr\ \{\$vy/\$a\}\]\n\ \ \ \ \ \ \ \ \n\ \ \ \ \ \ \ \ set\ vLen\ \[expr\ double(\$ANIM(VMAX))\]\n\ \ \ \ \}\n\ \ \ \ \n\ \ \ \ \ #\ since\ speed\ zero\ won't\ be\ never\ reached,\n\ \ \ \ \ #\ \ compute\ time\ to\ reach\ speed\ VMIN\n\ \ \ \ set\ a\ \[expr\ \{\$ANIM(VMIN)\ /\ \$vLen\}\]\n\ \ \ \ set\ duration\ \[expr\ \{log(1/\$a)/\$ANIM(K)\}\]\n\ \ \ \ \ #\ then\ compute\ the\ position\ (displacement)\ we\ will\ reach\ in\ \$duration\n\ \ \ \ set\ DX\ \[expr\ \{\$vx/\$ANIM(K)*(\ 1-\$a\ )\}\]\n\ \ \ \ set\ DY\ \[expr\ \{\$vy/\$ANIM(K)*(\ 1-\$a\ )\}\]\n\n\ \ \ \ \n\ \ \ \ set\ id\ \ \[\$w\ find\ withtag\ current\]\n\ \ \ \ lassign\ \[\$w\ coords\ \$id\]\ X0\ Y0\n\ \ \ \ \ #\ move\ object\ from\ (X0,Y0)\ to\ (X0+DX,Y0+DY)\ \ within\ time-interval\ (now,\ now+duration)\n\ \ \ \ _KEEPONMOVING\ \[list\ \$w\ \$id\]\ \$X0\ \$Y0\ \$DX\ \$DY\ \[now\]\ \$duration\n\ \}\n\n\n\ \ #\ when\ you\ click,\ stop\ all\ moving\ objects\ \n\ bind\ .c\ <ButtonPress-1>\ \{\n\ \ \ \ global\ ANIM\n\ \ \ \ foreach\ \{key\ val\}\ \[array\ get\ ANIM\ ID,*\]\ \{\n\ \ \ \ \ \ \ \ after\ cancel\ \$val\n\ \ \ \ \ \ \ \ array\ unset\ ANIM\ \$key\n\ \ \ \ \}\n\ \}\n\n\n\ proc\ _KEEPONMOVING\ \{objID\ X0\ Y0\ DX\ DY\ T0\ DT\}\ \{\n\ \ \ \ global\ ANIM\n\ \ \ \ lassign\ \$objID\ w\ id\n\ \ \ \ \n\ \ \ \ set\ t\ \[expr\ (\[now\]-\$T0)/\$DT\]\n\ \ \ \ if\ \{\ \$t\ >\ 1.0\ \}\ \{\ set\ t\ 1.0\ \}\n\ \ \ \ #\ ----\ easing\ transformation\ -----\n\ \ \ \ \ #\ set\ tt\ \[expr\ \{1-exp(-\$ANIM(K)*\$t)\}\]\n\ \ \ \ set\ tt\ \[expr\ \{1-exp(-\$ANIM(K)*\$t*\$DT)\}\]\n\ \ \ \ #\ -\ -\ -\ -\ -\ -\ \n\ \ \ \ set\ px\ \[expr\ \{\$X0+\$tt*\$DX\}\]\n\ \ \ \ set\ py\ \[expr\ \{\$Y0+\$tt*\$DY\}\]\n\ \ \ \ \n\ \ \ \ _MOVE_TO\ \$w\ \$id\ \$px\ \$py\n\ \ \ \ if\ \{\ \$t\ <\ 1.0\ \}\ \{\ \ \ \ \ \ \n\ \ \ \ \ \ \ \ set\ ANIM(ID,\$objID)\ \[after\ 40\ \ \[list\ _KEEPONMOVING\ \$objID\ \$X0\ \$Y0\ \$DX\ \$DY\ \$T0\ \$DT\]\]\n\ \ \ \ \}\ else\ \{\n\ \ \ \ \ \ \ \ #\ end\ of\ animation,\ unset\ unused\ memory\n\ \ \ \ \ \ \ \ array\ unset\ ANIM\ ID,\$objID\n\ \ \ \ \}\n\ \}\n\n\n\ proc\ _MOVE_TO\ \{w\ id\ x\ y\}\ \{\ \ \n\ \ lassign\ \[\$w\ coords\ \$id\]\ x0\ y0\n\ \ \$w\ move\ \$id\ \[expr\ \$x-\$x0\]\ \[expr\ \$y-\$y0\]\n\ \}\n======\n\n\[Ro\]:\ Very\ cool.\ Enjoyable!\n\n======\n\n<<categories>>\ GUI} CALL {my revision {Kinetic scrolling}} CALL {::oo::Obj1359498 process revision/Kinetic+scrolling} CALL {::oo::Obj1359496 process}

-errorcode

NONE

-errorinfo

Unknow state transition: LINE -> END
    while executing
"error $msg"
    (class "::Wiki" method "render_wikit" line 6)
    invoked from within
"my render_$default_markup $N $C $mkup_rendering_engine"
    (class "::Wiki" method "render" line 8)
    invoked from within
"my render $name $C"
    (class "::Wiki" method "revision" line 31)
    invoked from within
"my revision $page"
    (class "::Wiki" method "process" line 56)
    invoked from within
"$server process [string trim $uri /]"

-errorline

4