From: Thorsten S. <tho...@sc...> - 2000-05-12 23:07:06
|
Hi, I had a look at the positioning code in gtk_main_window.c and found a few problems. The calculation of the values for "right" and "bottom" was wrong, and the non-printable areas got ignored. The following patch fixes that, the values of 'right', 'left', 'top' and 'bottom' are now calculated with respect to their respective paper edges. (In other words, if you set 'right' to 3, the right edge of your print should end up 3 inches from the right edge of the paper). Clicking 'center' now also results in correct values for all sides. I've also done some code cleanup, e.g. at a couple of places values were calculated more than once. And I've added a second frame in the preview which shows the edges of the printable area inside the paper. Unfortunately, though I think the values calculated are correct, the print does not quite end up at the correct place, it seems too low by about 3mm and left by about 1mm (on my 440, with 360dpi setting). But there was some discussion about problems with the softweave code positioning, so I guess that might be the reason. I've changed a few variable names to make the distinction between printable area and paper area more clear; I've left vars.left and vars.top relative to the edges of the printable area (this is correct, isn't it? Meaning 0 / 0 means the image is located against the top left of the printable area? ) I don't quite understand how the plugin decides between gimp_main_window and gtk_main_window, I've patched only the one that it is using in my case, but if required the other one should be straightforward. There is some code in there that prevents people from moving the image (partially) outside the printable area, I wonder if this is desirable / required? Would it make more sense to allow partial clipping ? Would the print code cope with negative offsets? One thing that still would be very useful is the use of units as configured in Gimp instead of inches; but I first have to find out how to do that (and in a way that it does not break older gimps). regards thorsten ----------------------------------------------------------------------- Thorsten Schnier School of Computer Science University of Birminghan T.S...@cs... tho...@sc... |