lib/vedeu/cursors/refresh.rb in vedeu-0.6.62 vs lib/vedeu/cursors/refresh.rb in vedeu-0.6.63
- old
+ new
@@ -11,10 +11,19 @@
class Refresh
extend Forwardable
include Vedeu::Common
+ def_delegators :cursor,
+ :ox,
+ :oy,
+ :render,
+ :visible,
+ :visible?,
+ :x,
+ :y
+
def_delegators :geometry,
:bordered_height,
:bordered_width
# @example
@@ -43,15 +52,14 @@
# @return [Array]
def by_name
refresh_view if refresh_view?
Vedeu.log(type: :output,
- message: "Refreshing cursor: '#{name}' (x:#{cursor.x}, " \
- "y:#{cursor.y}, ox:#{cursor.ox}, oy:#{cursor.oy}, " \
- "visible:#{cursor.visible})".freeze)
+ message: "Refreshing cursor: '#{name}' (x:#{x}, y:#{y}, " \
+ "ox:#{ox}, oy:#{oy}, visible:#{visible})".freeze)
- cursor.render
+ render
end
private
# @return [String|Symbol]
@@ -69,11 +77,10 @@
# outside the (bordered) width and (bordered) height of the
# named interface.
#
# @return [Boolean]
def refresh_view?
- cursor.visible? && (cursor.ox >= bordered_width ||
- cursor.oy >= bordered_height)
+ visible? && (ox >= bordered_width || oy >= bordered_height)
end
# @return [Vedeu::Cursors::Cursor]
# @see Vedeu::Cursors::Repository#by_name
def cursor