diff --git a/lib/slide_helper.rb b/lib/slide_helper.rb index 3ba1b2af38cad7817045965ca8b2da7431559eb4..ceccac63a83b4aed7a2ce03e04eaa895684d8f8c 100644 --- a/lib/slide_helper.rb +++ b/lib/slide_helper.rb @@ -28,6 +28,10 @@ # # Move one slide unit left and create a new slide # +# !SLIDE_MOVE x y +# +# Move x units horizontal and y units vertical +# # !SLIDE_RELATIVE rx ry # # Useful for making slides within slides, e.g. @@ -210,6 +214,8 @@ module SlideHelper output += impress_slide_left(args) + "\n" when '!SLIDE_DOWN' output += impress_slide_down(args) + "\n" + when '!SLIDE_MOVE' + output += impress_slide_move(args) + "\n" when '!SLIDE_SCALE_LEFT' output += impress_slide_scale_left(args) + "\n" when '!SLIDE_RELATIVE' @@ -300,6 +306,15 @@ module SlideHelper impress_make_slide(args) end + def impress_slide_move(args) + argv = args.split + rx, ry = argv[0..1].map {|v| v.to_f} + rem_args = argv[2..].join(' ') + @@pos.x += rx * impress_horiz_mov_unit() + @@pos.y += ry * impress_vert_mov_unit() + impress_make_slide(rem_args) + end + def impress_slide_scale_left(args) argv = args.split scale = argv[0].to_f