Sha256: f603b0e1540e7612d4f28edc5f8d36bf91c13e5d8184626362dad331143ac5f4
Contents?: true
Size: 1.59 KB
Versions: 43
Compression:
Stored size: 1.59 KB
Contents
def color_circle_slide(slides, name="color-circle-slide") slides.delete_pre_draw_proc_by_name(name) slides.add_pre_draw_proc(name) do |slide, canvas, x, y, w, h, simulation| unless simulation cx = w * 0.22 cy = h * 0.72 r = w * 0.35 canvas.draw_circle_by_radius(true, cx, cy, r, @color_circle_light_color) r = w * 0.34 canvas.draw_circle_by_radius(true, cx, cy, r, @color_circle_bright_color) r = w * 0.28 canvas.draw_circle_by_radius(true, cx, cy, r, @color_circle_light_color) end [x, y, w, h] end end def color_circle_title(titles, name="color-circle-title") titles.delete_pre_draw_proc_by_name(name) titles.delete_post_draw_proc_by_name(name) margin = canvas.width * 0.2 line_width = {:line_width => screen_size(0.1)} titles.margin_top = screen_y(1) titles.margin_left = margin titles.margin_bottom = canvas.height * 0.1 titles.add_pre_draw_proc(name) do |title, canvas, x, y, w, h, simulation| unless simulation ly = y + title.first_line_height canvas.draw_line(x, ly, x + w, ly, "black", line_width) base_h = title.first_line_height * 0.8 cx = margin * 0.25 cy = y + base_h * 0.8 r = base_h * 0.3 rest = margin - cx ratio = rest / (r * 2.5) canvas.draw_circle_by_radius(false, cx, cy, r, @color_circle_color, line_width) cx += r * ratio canvas.draw_circle_by_radius(true, cx, cy, r, @color_circle_color) cx += r * ratio canvas.draw_circle_by_radius(true, cx, cy, r, @color_circle_color) end [x, y, w, h] end end
Version data entries
43 entries across 43 versions & 1 rubygems