bugGNU Octave - Bugs: bug #35430, fltk figure units =...

 
 

bug #35430: fltk figure units = "normalized" shrinks plot to 1 pixel

Submitted by:  Ben Abbott <bpabbott>
Submitted on:  Wed 01 Feb 2012 07:11:19 PM UTC  
 
Category: Plotting with OpenGLSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: FixedAssigned to: None
Originator Name: Ben AbbottOpen/Closed: Closed
Release: devOperating System: Any

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sun 12 Feb 2012 02:14:34 AM UTC, comment #7:

I pushed a changeset

http://hg.savannah.gnu.org/hgweb/octave/rev/e7c74f56cd03

I'm closing the report.

Ben Abbott <bpabbott>
Project Member
Sat 11 Feb 2012 01:08:55 AM UTC, comment #6:

I attached a changeset that works for me. It avoids triggering listeners (as suggested by Michael Goffioul).

Using the default branch, and with the tip below, it works for me.

(file #25044)

Ben Abbott <bpabbott>
Project Member
Sun 05 Feb 2012 01:49:48 AM UTC, comment #5:

I've put together a 2nd changset. It doesn't do as Michael suggested (I was unable -- maybe due to my lack of c++ experience -- to do as he suggested).

(file #24983)

Ben Abbott <bpabbott>
Project Member
Sat 04 Feb 2012 11:31:29 PM UTC, comment #4:

That changeset only works when drawnow() is called. A broader solution is needed.

Michael Goffioul made the suggestion below,

In _init_fltk_.cc, plot_window::draw() maps figure's position property to the FLTK window location (which is in pixels). This is only valid when the figure's units is in pixels [1]. The proper implementation is to use the figure::properties::get_boundingbox() method to obtain the figure location in pixels.

Ben Abbott <bpabbott>
Project Member
Sat 04 Feb 2012 09:33:44 PM UTC, comment #3:

I've attached a patch.

(file #24982)

Ben Abbott <bpabbott>
Project Member
Thu 02 Feb 2012 07:26:43 PM UTC, comment #2:

Another observation. Running the script below produces the correct output to the console

The output is

If a drawnow() is inserted before the get() command, then the incorrect result is returned.

The incorrect output is

Ben Abbott <bpabbott>
Project Member
Thu 02 Feb 2012 01:44:40 AM UTC, comment #1:

More info. First with gnuplot

Now with fltk

Gnuplot and fltk behave differently.

I hadn't realized that this part of the code was backend specific.

Ben Abbott <bpabbott>
Project Member
Wed 01 Feb 2012 07:11:19 PM UTC, original submission:

These commands display an empty figure as expected.

Changing the units to normalized results in a small figure in the UL of the screen (1 pixel wide ?)

Ben Abbott <bpabbott>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #25044:  changeset-7.patch added by bpabbott (3KiB - application/octet-stream)
file #24983:  changeset-__init_fltk__.patch added by bpabbott (837B - application/octet-stream - 2nd changeset)
file #24982:  changeset.patch added by bpabbott (837B - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bpabbott (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 07 Aug 2013 11:30:07 PM UTCbpabbottStatusReady For Test=>Fixed
    Sun 12 Feb 2012 02:14:34 AM UTCbpabbottOpen/ClosedOpen=>Closed
    Sat 11 Feb 2012 01:09:52 AM UTCbpabbottStatusPatch Submitted=>Ready For Test
    Sat 11 Feb 2012 01:08:55 AM UTCbpabbottAttached File-=>Added changeset-7.patch, #25044
    Sun 05 Feb 2012 01:49:48 AM UTCbpabbottAttached File-=>Added changeset-__init_fltk__.patch, #24983
    Sat 04 Feb 2012 09:33:44 PM UTCbpabbottAttached File-=>Added changeset.patch, #24982
      StatusNone=>Patch Submitted

    Back to the top


    Powered by Savane 3.1-cleanup1