[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with printing plots
From: |
Michael Goffioul |
Subject: |
Re: Problem with printing plots |
Date: |
Sat, 10 Mar 2012 08:44:21 +0000 |
On Sat, Mar 10, 2012 at 1:41 AM, Ben Abbott <address@hidden> wrote:
>> The attached passed a few tests for me, but I suspect it is ugly to those
>> with c++ skills.
>>
>> Critiques welcome :-)
>>
>> Ben
>>
>> <changeset.patch>
>
> This change breaks the synchronization of the axes position.
>
> To see the effect run the legend demos.
I think your patch is a bit too complicated and misses a few things,
especially running automatic updaters. The easiest is to start from
the auto-generated code (did you have a look at it?):
void set_position (const octave_value& val)
{
if (! error_state)
{
if (position.set (val, false))
{
set_positionmode ("manual");
update_position ();
position.run_listeners (POSTSET);
mark_modified ();
}
else
set_positionmode ("manual");
}
}
As you can see, you're missing calling update_position() and
set_positionmode(). I can;t test at the moment, but what I'd do is
something like this:
void set_position (const octave_value& val)
{
if (! error_state)
{
octave_value new_val (val);
if (new_val.numel () == 2)
{
dim_vector dv (1, 3);
new_val = new_val.resize (dv, true);
}
if (position.set (new_val, false))
{
set_positionmode ("manual");
update_position ();
position.run_listeners (POSTSET);
mark_modified ();
}
else
set_positionmode ("manual");
}
}
Michael.
- Re: Problem with printing plots, (continued)
- Re: Problem with printing plots, Michael Goffioul, 2012/03/09
- Re: Problem with printing plots, Ben Abbott, 2012/03/09
- Re: Problem with printing plots, Ben Abbott, 2012/03/09
- Re: Problem with printing plots, Ben Abbott, 2012/03/09
- Re: Problem with printing plots, Michael Goffioul, 2012/03/09
- Re: Problem with printing plots, Ben Abbott, 2012/03/09
- Re: Problem with printing plots, Ben Abbott, 2012/03/09
- Re: Problem with printing plots, Michael Goffioul, 2012/03/09
- Re: Problem with printing plots, Ben Abbott, 2012/03/09
- Re: Problem with printing plots, Ben Abbott, 2012/03/09
- Re: Problem with printing plots,
Michael Goffioul <=
- Re: Problem with printing plots, Ben Abbott, 2012/03/10
- Re: Problem with printing plots, Michael Goffioul, 2012/03/10
- Re: Problem with printing plots, Ben Abbott, 2012/03/10
- Re: Problem with printing plots, Michael Goffioul, 2012/03/10
- Re: Problem with printing plots, Ben Abbott, 2012/03/10
- Re: Problem with printing plots, logari81, 2012/03/12
- Re: Problem with printing plots, Jordi GutiƩrrez Hermoso, 2012/03/10
- Re: Problem with printing plots, Michael Goffioul, 2012/03/09