[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #52940] Regression with "PaperPosition" and pr
From: |
Dan Sebald |
Subject: |
[Octave-bug-tracker] [bug #52940] Regression with "PaperPosition" and printing |
Date: |
Mon, 29 Jan 2018 00:21:25 -0500 (EST) |
User-agent: |
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0 |
Follow-up Comment #38, bug #52940 (project octave):
OK, I'm attaching a new changeset that implements what I had described. The
elements in axes::properties that seem more geared for the renderer have been
moved to the graphics_xform. That way each opengl_renderer and derivative
object can get its own transform. The key change here to make gl2ps_renderer
work without the change in figure "position" property is the following:
(opengl_renderer::setup_opengl_transformation): Move the storage of xform
to the start of the function then use it to retrieve x_zlim, x_gl_mat1 and
x_gl_mat2. Note, parent_pix_size is passed into get_transform() to get
transform appropriate for on-screen or print mode.
So, that's the basic design change. All else is either a regrouping of
parameters for convenience *or* a removal of things that no longer need to be
done. There is a lot of cleanup that anyone interested could do to make this
approach better, but this should do.
I think there is a bug or two currently covered up for FLTK graphics toolkit
by the pre-patch approach of setting and restoring figure properties. I left
a note in the changeset:
- ## print() requires figure units to be "pixels"
- props(end+1).h = opts.figure;
- props(end).name = "units";
- props(end).value = {get(opts.figure, "units")};
- set (opts.figure, "units", "pixels");
- nfig += 1;
-
## graphics toolkit translates figure position to eps bbox (points)
+ ## 1/28/18 This should no longer be necessary, but the FLTK toolkit
+ ## on-screen axes position shifts if this is not restored.
fpos = get (opts.figure, "position");
props(end+1).h = opts.figure;
props(end).name = "position";
props(end).value = {fpos};
- fpos(3:4) = opts.canvas_size;
- set (opts.figure, "position", fpos);
By my way of thinking, there should no longer be a need for changing figure
"units" or "position". The axes::properties bounding-box code seems to
address this by converting any units to pixels. However, although the
position property no longer needs to be set for printing, for FLTK toolkit
there is a shift in the on-screen plot without restoring. The Qt toolkit
seems fine though. I don't want to concern myself with that though, as it
isn't the real issue--so I left that in for now.
I did test the non-screen-visible printing for Qt and FLTK. It seems to work
for Qt, but not for FLTK. So I've made a change that allows Qt toolkit to do
non-visible printing rather than use __osmesa_print__. Might this obviate the
manual compilation issue for those with Nvidia drivers?
Rik, I'm tempted to drop the use of __guidata__ and just compute the parent
position size internally using the PaperPosition property. What do you think?
(file #43101)
_______________________________________________________
Additional Item Attachment:
File name: octave-gl2ps_viewport_print_nonvisible-djs2018jan28.patch Size:29
KB
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?52940>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
- [Octave-bug-tracker] [bug #52940] Regression with "PaperPosition" and printing, (continued)
- [Octave-bug-tracker] [bug #52940] Regression with "PaperPosition" and printing, Rik, 2018/01/24
- [Octave-bug-tracker] [bug #52940] Regression with "PaperPosition" and printing, Dan Sebald, 2018/01/24
- [Octave-bug-tracker] [bug #52940] Regression with "PaperPosition" and printing, Dan Sebald, 2018/01/24
- [Octave-bug-tracker] [bug #52940] Regression with "PaperPosition" and printing, Rik, 2018/01/24
- [Octave-bug-tracker] [bug #52940] Regression with "PaperPosition" and printing, Dan Sebald, 2018/01/25
- [Octave-bug-tracker] [bug #52940] Regression with "PaperPosition" and printing, Rik, 2018/01/26
- [Octave-bug-tracker] [bug #52940] Regression with "PaperPosition" and printing, Dan Sebald, 2018/01/26
- [Octave-bug-tracker] [bug #52940] Regression with "PaperPosition" and printing, Michael Godfrey, 2018/01/26
- [Octave-bug-tracker] [bug #52940] Regression with "PaperPosition" and printing, Pantxo Diribarne, 2018/01/28
- [Octave-bug-tracker] [bug #52940] Regression with "PaperPosition" and printing, Rik, 2018/01/28
- [Octave-bug-tracker] [bug #52940] Regression with "PaperPosition" and printing,
Dan Sebald <=
- [Octave-bug-tracker] [bug #52940] Regression with "PaperPosition" and printing, Dan Sebald, 2018/01/29
- [Octave-bug-tracker] [bug #52940] Regression with "PaperPosition" and printing, Dan Sebald, 2018/01/29
- [Octave-bug-tracker] [bug #52940] Regression with "PaperPosition" and printing, Pantxo Diribarne, 2018/01/31