lib/ctioga2/graphics/legends/area.rb in ctioga2-0.0 vs lib/ctioga2/graphics/legends/area.rb in ctioga2-0.1

- old
+ new

@@ -14,20 +14,20 @@ require 'ctioga2/utils' require 'ctioga2/log' module CTioga2 - Version::register_svn_info('$Revision: 80 $', '$Date: 2009-06-09 23:56:44 +0200 (Tue, 09 Jun 2009) $') + Version::register_svn_info('$Revision: 155 $', '$Date: 2010-06-21 21:41:32 +0200 (Mon, 21 Jun 2010) $') module Graphics # This module holds all the classes dealing with legends module Legends # This class holds a series of legends for curves. # - # TODO: + # \todo # # * a legend can be plotted either inside a plot or outside the # root object # # * in case it is plotted outside the root object, the user should @@ -42,11 +42,11 @@ # # * whenever a --legend-inside is specified, we create a private # @legend_area for the current Elements::Container, with the # given position. # - # TODO: make a subclass for a top-level area ???? + # \todo make a subclass for a top-level area ???? class LegendArea # The style of the LegendStorage, a Styles::LegendStorageStyle # object (of course) attr_accessor :legend_style @@ -68,11 +68,11 @@ # Draws the legend of the given container and all its # subobjects. It assumes that the frames have been set # according to the return value of #partition_frame # - # TODO: + # \todo # # * customization of the x and y of origin (y should match the # top of the corresponding graph, if applicable) # # * add padding on the external side of the legend, if @@ -84,14 +84,14 @@ t.rescale(@legend_style.scale) t.rescale_text(@legend_style.text_scale) # We make figure coordinates frame coordinates t.set_bounds([0, 1, 1, 0]) - # TODO: customize this ! + # \todo customize this ! x, y = initial_xy(t, container) for item in items - # TODO: transform the 0.0 for x into a negative + # \todo transform the 0.0 for x into a negative # user-specifiable stuff. item.draw(t, @legend_style, x , y) y -= @legend_style.dy.to_figure(t,:y) end end @@ -174,15 +174,15 @@ # inside the legend frame. Depends on a lot of things, # including the type of the legend. def initial_xy(t, container) case @legend_type when :right - l,r,t,b = container.subframe.to_frame_margins(t) + l,r,t,b = container.actual_subframe(t).to_frame_margins(t) # Here, we take profit from the fact that frame # coordinates are also figure coordinates within the # legend. - # TODO: that won't work in the case of labels on the + # \todo that won't work in the case of labels on the # right-hand-side. return [- l/2, 1.0 - t] when :inside return [0.0, 1.0] else