1 | static void animateBounds(final JComponent c, final Rect a, final Rect b) { |
2 | animateBounds(c, a, b, 1); |
3 | } |
4 | |
5 | static void animateBounds(final JComponent c, final Rect a, final Rect b, final double seconds) { |
6 | final long startTime = sysNow(); |
7 | awtEvery(c, 20, func { |
8 | double s = msToSeconds(sysNow()-startTime)/seconds; |
9 | if (s >= 1) { |
10 | setBounds(c, b); |
11 | false; |
12 | } |
13 | setBounds(c, blendRects(a, b, s)); |
14 | null; |
15 | }); |
16 | } |
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1010656 |
Snippet name: | animateBounds |
Eternal ID of this version: | #1010656/6 |
Text MD5: | 4a18f3b87561946fe85b4bd2049a2db5 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2017-09-24 03:14:02 |
Source code size: | 453 bytes / 16 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 449 / 526 |
Version history: | 5 change(s) |
Referenced in: | [show references] |