[OpenJDK 2D-Dev] [9] RFR JDK-6601097:Margins are not reset to hardware margins when width/height is 0 or -ve alongwith x, y

2016-05-19 Thread prasanta sadhukhan
Hi All, Please review a fix for jdk9 which is a continuation of the fix of JDK-6543815. Bug: https://bugs.openjdk.java.net/browse/JDK-6601097 webrev: http://cr.openjdk.java.net/~psadhukhan/6601097/webrev.00/ 6543815 fix resets the x,y to 0 if they are negative before creating a MediaPrintabl

Re: [OpenJDK 2D-Dev] [9] RFR JDK-6601097:Margins are not reset to hardware margins when width/height is 0 or -ve alongwith x, y

2016-05-23 Thread Jayathirth D V
: [OpenJDK 2D-Dev] [9] RFR JDK-6601097:Margins are not reset to hardware margins when width/height is 0 or -ve alongwith x, y Hi All, Please review a fix for jdk9 which is a continuation of the fix of JDK-6543815. Bug: https://bugs.openjdk.java.net/browse/JDK-6601097 webrev: http

Re: [OpenJDK 2D-Dev] [9] RFR JDK-6601097:Margins are not reset to hardware margins when width/height is 0 or -ve alongwith x, y

2016-05-25 Thread Philip Race
It seems to me that you are using the wrong units. You have not divided by DPI to get inches. Also I am not sure that the *entire* width/height of the paper is what you want here but that is secondary to the first issue -phil On 5/19/16, 2:59 AM, prasanta sadhukhan wrote: Hi All, Please rev

Re: [OpenJDK 2D-Dev] [9] RFR JDK-6601097:Margins are not reset to hardware margins when width/height is 0 or -ve alongwith x, y

2016-05-26 Thread prasanta sadhukhan
Hi Phil, I got it rectified. Please find the modified webrev http://cr.openjdk.java.net/~psadhukhan/6601097/webrev.01/ Regarding using entire width/height pf paper, I thought since imageable width/height is invalid we should make the entire paper as the imageable area.For invalid x,y we were

Re: [OpenJDK 2D-Dev] [9] RFR JDK-6601097:Margins are not reset to hardware margins when width/height is 0 or -ve alongwith x, y

2016-05-31 Thread Phil Race
Well ... few printers can print on the entire paper. Photo printers are the ones that can do this. So Paper dimension minus the "hardware margins" are the maximum imageable width. And then supposing imageable x/y is some perfectly reasonable value like 1" each then you've set iw/ih such that even

Re: [OpenJDK 2D-Dev] [9] RFR JDK-6601097:Margins are not reset to hardware margins when width/height is 0 or -ve alongwith x, y

2016-06-01 Thread prasanta sadhukhan
Hi Phil, Actually, the test program does 3 subtests 1. negative y we get ix=12, iy=12, iw=571, ih=817 in Margins.java#print() where we do System.out.println("ix="+ix+" iy="+iy+" iw="+iw+" ih="+ih); which is correctly getting hardware margin and not Java default 1" margin 2. printable heigh

Re: [OpenJDK 2D-Dev] [9] RFR JDK-6601097:Margins are not reset to hardware margins when width/height is 0 or -ve alongwith x, y

2016-06-08 Thread prasanta sadhukhan
Hi Phil, As discussed offline, regarding mpa modification in both setAttributes() and updateAttributesWithPageFormat, I found that updateAttributesWithPageFormat() will be called during pageDialog() and setPrintable() whereas setAttributes() will be called during print() and setAttributes() ca

Re: [OpenJDK 2D-Dev] [9] RFR JDK-6601097:Margins are not reset to hardware margins when width/height is 0 or -ve alongwith x, y

2016-06-15 Thread Philip Race
I did say so long as the "ix/iy" are also valid. Which means not just positive but that they are not too large. Consider if (iw<= 0) iw = (float)(page.getPaper().getWidth()/DPI) - (ix*2); if we have ix = 500 and iw = -20 for a paper with width 800 this will result in iw = 800 - (500*2) = -200

Re: [OpenJDK 2D-Dev] [9] RFR JDK-6601097:Margins are not reset to hardware margins when width/height is 0 or -ve alongwith x, y

2016-06-16 Thread prasanta sadhukhan
Hi Phil, Ok. I have added a check for this case in which it will fall back to default values since if ix/iy is too large then we probably will not get anything to print inside printable area if we have to leave same margin on the right/bottom of the paper. validatePaper() does not check for i

Re: [OpenJDK 2D-Dev] [9] RFR JDK-6601097:Margins are not reset to hardware margins when width/height is 0 or -ve alongwith x, y

2016-06-22 Thread Philip Race
+1 .. they won't get any output with a zero-width imageable area but this is last ditch fix up of excessively bad values. -phil. On 6/16/16, 11:32 PM, prasanta sadhukhan wrote: Hi Phil, Ok. I have added a check for this case in which it will fall back to default values since if ix/iy is too

Re: [OpenJDK 2D-Dev] [9] RFR JDK-6601097:Margins are not reset to hardware margins when width/height is 0 or -ve alongwith x, y

2016-06-23 Thread Jayathirth D V
.   Thanks, Jay   From: Philip Race Sent: Wednesday, June 22, 2016 9:08 PM To: prasanta sadhukhan Cc: 2d-dev@openjdk.java.net Subject: Re: [OpenJDK 2D-Dev] [9] RFR JDK-6601097:Margins are not reset to hardware margins when width/height is 0 or -ve alongwith x, y   +1 .. they won't get any o