RFR: 8316518 javafx.print.Paper getWidth / getHeight rounds values, causing errors.
Kevin Rushforth
kcr at openjdk.org
Fri Sep 22 18:10:17 UTC 2023
On Fri, 22 Sep 2023 17:34:45 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
> yeah, I also don't quite understand why we have the rounding (I mean, floor'ing) here. I would vote to remove the typecast as the OP proposes.
Phil has some concerns that will need to be looked into.
> But there is more:
>
> 1. why in the world the constructor is not public? what if I need to print a Commercial 8-5/8 envelope?
That's the wrong question to ask, and this PR is the wrong place to ask it. If I could reformulate your question, I might rather state it as "would it be a useful enhancement to allow Paper to be customizable?". Maybe (or maybe not), but as with any other new feature, it needs proper motivation, etc.
> 2. what is going on in hashCode??
>
> ```
> public final int hashCode() {
> return (int)width+((int)height<<16)+units.hashCode();
> }
> ```
This is also unrelated to this PR. It may or may not be a great `hashCode` implementation, but It meets the contract of hasCode w.r.t. equals. And if it didn't, it would need a separate bug.
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1244#discussion_r1334687579
More information about the openjfx-dev
mailing list