~ubuntu-branches/ubuntu/wily/ctioga2/wily

« back to all changes in this revision

Viewing changes to lib/ctioga2/graphics/legends/area.rb

  • Committer: Package Import Robot
  • Author(s): Vincent Fourmond
  • Date: 2013-07-08 20:58:17 UTC
  • mfrom: (6.1.1 experimental)
  • Revision ID: package-import@ubuntu.com-20130708205817-cephnc6etndyxrrp
Tags: 0.4-2
* Upload to unstable
* Already conforms to newer standards

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
module CTioga2
18
18
 
19
 
  Version::register_svn_info('$Revision: 285 $', '$Date: 2011-02-22 21:12:47 +0100 (Tue, 22 Feb 2011) $')
 
19
  Version::register_svn_info('$Revision: 359 $', '$Date: 2012-12-26 10:45:35 +0100 (Wed, 26 Dec 2012) $')
20
20
 
21
21
  module Graphics
22
22
 
27
27
      #
28
28
      # \todo
29
29
      # 
30
 
      # * a legend can be plotted either inside a plot or outside the
31
 
      #   root object
32
 
      #   
33
 
      # * in case it is plotted outside the root object, the user should
34
 
      #   be able to choose whether it should be counted in the
35
 
      #   real-size or not.
36
 
      #
37
30
      # * legends should provide all the kind of things that were in the
38
31
      #   first ctioga, such as background, frames, and so on...
39
32
      #
88
81
            t.set_bounds([0, 1, 1, 0])
89
82
            ## \todo customize this !
90
83
            x, y = initial_xy(t, container)
 
84
 
 
85
            w,h = *size(t, container)
 
86
            h /= @legend_style.scale * @legend_style.text_scale
 
87
            @legend_style.frame.
 
88
              draw_box_around(t, x, y,
 
89
                              x + w, y - h, @legend_style.frame_padding)
 
90
            
91
91
            for item in items
92
92
              ## \todo transform the 0.0 for x into a negative
93
93
              # user-specifiable stuff.