octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Updaters and default property values (was :Changeset 14257 oddities)


From: Ben Abbott
Subject: Re: Updaters and default property values (was :Changeset 14257 oddities)
Date: Mon, 12 Mar 2012 17:10:46 -0400

On Mar 12, 2012, at 10:04 AM, Ben Abbott wrote:

> On Mar 12, 2012, at 5:41 AM, Michael Goffioul wrote:
> 
>> On Mon, Mar 12, 2012 at 1:48 AM, Ben Abbott <address@hidden> wrote:
>>> Rik,
>>> 
>>> I just realized the images produced for the docs are modifying the default 
>>> paperorientation to "landscape". The entire sequence is ...
>>> 
>>> function set_print_size ()
>>> image_size = [5.0, 3.5];
>>> border = 0;
>>> set (0, "defaultfigurepapertype", "<custom>");
>>> set (0, "defaultfigurepaperorientation", "landscape");
>>> set (0, "defaultfigurepapersize", image_size + 2*border);
>>> set (0, "defaultfigurepaperposition", [border, border, image_size]);
>>> endfunction
>>> 
>>> And when the defaults are populated into a new figure the updating of the 
>>> property values are not working as intended.
>>> 
>>> This is causing the images for the figures to be rotated and cropped.
>>> 
>>> I'm unfamiliar with how the initialization of an objects properties works.
>>> 
>>> Can someone explain the process to me, or point me to code that does this?
>> 
>> This is achieved in base_properties::set_from_list. This ends up
>> calling base_graphics_object::set, which will should end up calling
>> set_<property>.
>> 
>> Michael.
> 
> I took a quick look.  I think I'm following the part below
> 
> graphics.cc (base_properties::set_from_list)
> 
> But I don't see where base_graphics_object::set is defined.
> 
> In any event, set_<property>() should call the updaters correct ?
> 
> My first thought was that the updaters were not being called. That looks 
> wrong to me now.
> 
> If the updaters are being called, then something is broken.
> 
> Ben

As Michael also indicated that he also thought something was wrong with the 
updaters, I should have looked at this earlier today.

In any event, I took a quick look at update_papersize ... and found a bug !

When detecting the papertype the papersize is sorted, when in landscape 
orientation the sorting should be reversed and the papersize saved.

Trivial diff is attached. I'll push this later when I have the time.

Ben

Attachment: papersize.diff
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]