OLD | NEW |
1 function scale_text_delta(template, delta) | 1 function scale_text_delta(template, delta) |
2 template = template.slide | 2 template = template.slide |
3 for i = 1, #template do | 3 for i = 1, #template do |
4 local paint = template[i].paint | 4 local paint = template[i].paint |
5 paint:setTextSize(paint:getTextSize() + delta) | 5 paint:setTextSize(paint:getTextSize() + delta) |
6 end | 6 end |
7 end | 7 end |
8 | 8 |
9 function slide_transition(prev, next, is_forward) | 9 function slide_transition(prev, next, is_forward) |
10 local rec = { | 10 local rec = { |
(...skipping 21 matching lines...) Expand all Loading... |
32 rec.step_x = 15 | 32 rec.step_x = 15 |
33 rec.isDone = function (self) return self.curr_x >= 0 end | 33 rec.isDone = function (self) return self.curr_x >= 0 end |
34 end | 34 end |
35 return rec | 35 return rec |
36 end | 36 end |
37 | 37 |
38 function sqr(value) return value * value end | 38 function sqr(value) return value * value end |
39 | 39 |
40 function set_blur(paint, alpha) | 40 function set_blur(paint, alpha) |
41 local sigma = sqr(1 - alpha) * 20 | 41 local sigma = sqr(1 - alpha) * 20 |
42 -- paint:setImageFilter(Sk.newBlurImageFilter(sigma, sigma)) | 42 if gUseBlurInTransitions then |
| 43 paint:setImageFilter(Sk.newBlurImageFilter(sigma, sigma)) |
| 44 end |
43 paint:setAlpha(alpha) | 45 paint:setAlpha(alpha) |
44 end | 46 end |
45 | 47 |
46 function fade_slide_transition(prev, next, is_forward) | 48 function fade_slide_transition(prev, next, is_forward) |
47 local rec = { | 49 local rec = { |
48 paint = Sk.newPaint(), | 50 paint = Sk.newPaint(), |
49 prevDrawable = prev, | 51 prevDrawable = prev, |
50 nextDrawable = next, | 52 nextDrawable = next, |
51 proc = function(self, canvas, drawSlideProc) | 53 proc = function(self, canvas, drawSlideProc) |
52 if self:isDone() then | 54 if self:isDone() then |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 end | 199 end |
198 | 200 |
199 gTransitionTable = { | 201 gTransitionTable = { |
200 fade = fade_transition, | 202 fade = fade_transition, |
201 slide = slide_transition, | 203 slide = slide_transition, |
202 fade_slide = fade_slide_transition, | 204 fade_slide = fade_slide_transition, |
203 rotate = rotate_transition, | 205 rotate = rotate_transition, |
204 zoom = zoom_transition, | 206 zoom = zoom_transition, |
205 } | 207 } |
206 | 208 |
OLD | NEW |