Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-09-30 Thread Sergey Bylokhov
On 27.09.16 21:13, Sergey Bylokhov wrote: The public API Looks fine. Just a few small notes which I would like to highlight one more time. The fix looks fine, I still think that the change on Java2D(like on OSX) side will be better approach for Swing. This change should additionally tested

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-09-27 Thread Philip Race
I have looked at the full webrev and it seems fine. -phil. On 9/27/16, 11:13 AM, Sergey Bylokhov wrote: The public API Looks fine. On 21.09.16 16:06, Alexandr Scherbatiy wrote: Hello, Could you review the updated fix: http://cr.openjdk.java.net/~alexsch/8156217/webrev.07/all_01 The

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-09-27 Thread Sergey Bylokhov
The public API Looks fine. On 21.09.16 16:06, Alexandr Scherbatiy wrote: Hello, Could you review the updated fix: http://cr.openjdk.java.net/~alexsch/8156217/webrev.07/all_01 The public API remains unchanged: http://cr.openjdk.java.net/~alexsch/8156217/webrev.07/public-api ParagraphView

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-09-20 Thread Alexandr Scherbatiy
On 9/20/2016 1:56 PM, Semyon Sadetsky wrote: Hi Alexander, why in the TextUI class the new viewToModel2D and modelToView2D methods implementations fall-back to the deprecated ones? TextUI is a public abstract class. There is no way to add a new abstract method to it and keep a backward

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-09-20 Thread Semyon Sadetsky
Yet another question: Why the floating point API doesn't work for JTextPane? Also it doesn't work for JTextArea, JTextField and JTextPane if i18n is on. --Semyon On 12.09.2016 15:19, Alexandr Scherbatiy wrote: Hello, Could you review the updated fix: all changes:

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-09-20 Thread Semyon Sadetsky
Hi Alexander, why in the TextUI class the new viewToModel2D and modelToView2D methods implementations fall-back to the deprecated ones? --Semyon On 12.09.2016 15:19, Alexandr Scherbatiy wrote: Hello, Could you review the updated fix: all changes:

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-09-12 Thread Alexandr Scherbatiy
Hello, Could you review the updated fix: all changes: http://cr.openjdk.java.net/~alexsch/8156217/webrev.07/all public API changes: http://cr.openjdk.java.net/~alexsch/8156217/webrev.07/public-api - @since 9 tag is added to new methods. Thanks, Alexandr. On 9/10/2016 2:36 AM,

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-09-09 Thread Philip Race
- * Returns the tab size set for the document, defaulting to 8. - * - * @implSpec This implementation calls {@link #getTabSize() getTabSize()}. - * - * @return the tab size - */ -protected float getFractionalTabSize() { -return getTabSize(); -} - It

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-09-01 Thread Semyon Sadetsky
On 9/1/2016 8:26 PM, Alexandr Scherbatiy wrote: On 9/1/2016 7:27 PM, Alexandr Scherbatiy wrote: On 9/1/2016 6:49 PM, Semyon Sadetsky wrote: Alexander, did you consider possibility to check if method is really over-riden then to use the old API? Could you give a sample how it can be

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-09-01 Thread Alexandr Scherbatiy
On 9/1/2016 7:27 PM, Alexandr Scherbatiy wrote: On 9/1/2016 6:49 PM, Semyon Sadetsky wrote: Alexander, did you consider possibility to check if method is really over-riden then to use the old API? Could you give a sample how it can be done? I think it is possible to use a reflection to

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-09-01 Thread Alexandr Scherbatiy
On 9/1/2016 6:49 PM, Semyon Sadetsky wrote: Alexander, did you consider possibility to check if method is really over-riden then to use the old API? Could you give a sample how it can be done? Thanks, Alexandr. --Semyon On 9/1/2016 3:07 PM, Alexandr Scherbatiy wrote: On 9/1/2016

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-09-01 Thread Semyon Sadetsky
Alexander, did you consider possibility to check if method is really over-riden then to use the old API? --Semyon On 9/1/2016 3:07 PM, Alexandr Scherbatiy wrote: On 9/1/2016 11:31 AM, Semyon Sadetsky wrote: Hi Alexander, It is a good style to add a note recommending what to use instead of

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-09-01 Thread Semyon Sadetsky
Hi Alexander, It is a good style to add a note recommending what to use instead of the method which is being deprecated. I did not get for what the useFloatingPointAPI property was introduced and moreover is set to false by default. If the old API is used then it doesn't matter which value

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-08-23 Thread Philip Race
This *really* needs someone else who knows the ins and outs of Swing to review it. The words on the model2View ones like * Converts the given place in the view coordinate system * to the nearest representative location in the model. make it sounds like absolute precision isn't what is needed

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-08-19 Thread Alexandr Scherbatiy
On 8/19/2016 2:25 AM, Philip Race wrote: OK .. I do not know enough about how modelToView is used by Swing to know what is really needed here. Someone with a bit more Swing background needs to chime in. I was encouraged that the *API* surface of the changes was much smaller than it had seemed

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-08-18 Thread Philip Race
OK .. I do not know enough about how modelToView is used by Swing to know what is really needed here. Someone with a bit more Swing background needs to chime in. I was encouraged that the *API* surface of the changes was much smaller than it had seemed from the webrev but maybe that is because

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-08-15 Thread Alexandr Scherbatiy
Hello, Could you review the updated fix? webrev which contains only change in public API: http://cr.openjdk.java.net/~alexsch/8156217/webrev.05/public-api webrev with contains all changes: http://cr.openjdk.java.net/~alexsch/8156217/webrev.05/all - methods with int coordinates

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-07-28 Thread Alexandr Scherbatiy
See comments inline. On 7/26/2016 11:57 PM, Phil Race wrote: I have a lot of doubts about this as well as trouble getting my head around all of it. Given that apps need to 'buy in' to the floating point I am not sure what we are gaining but I need to make sure I understand the problem. It

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-06-30 Thread Alexandr Scherbatiy
On 6/28/2016 8:14 PM, Alan Snyder wrote: Suppose an application is only partially fixed to use/override the floating point methods. Perhaps it uses a library that has not been fixed. Is there a more fine grained way to detect programmer awareness or lack of awareness of the new methods?

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-06-28 Thread Alan Snyder
Suppose an application is only partially fixed to use/override the floating point methods. Perhaps it uses a library that has not been fixed. Is there a more fine grained way to detect programmer awareness or lack of awareness of the new methods? Alan > On Jun 28, 2016, at 9:59 AM,

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-06-28 Thread Alexandr Scherbatiy
Hello, I tried to merge this fix with the 8132119 Provide public API for text related methods in SwingUtilities2 and found a flow in the used algorithm. For each method that uses integer coordinates the fix adds a pair with floating point arguments. The fix 8156217 uses only methods

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-06-16 Thread Alexandr Scherbatiy
I tried to look deeper in the code and it seems there is a rounding issue when float values are summed up. Suppose a transform with scale 1.5 is used and the 'a' char advance is 10 in a dev space. The 'a' char has advance 10 / 1.5 = 6.667 as double value and 6.665 when it is

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-06-02 Thread Alexandr Scherbatiy
On 5/31/2016 10:40 PM, Phil Race wrote: I applied this and it is *much* better but there still seem to be some tiny quirks. When I drag the mouse to select text down and then up again, as I pass the original mouse click point vertically, repaint seem to jiggle vertically by a pixel. Perhaps

Re: [9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-05-31 Thread Phil Race
I applied this and it is *much* better but there still seem to be some tiny quirks. When I drag the mouse to select text down and then up again, as I pass the original mouse click point vertically, repaint seem to jiggle vertically by a pixel. Perhaps a rounding issue in the repaint code's

[9] Review request for 8156217 Selected text is shifted on HiDPI display

2016-05-06 Thread Alexandr Scherbatiy
Hello, Could you review the fix: bug: https://bugs.openjdk.java.net/browse/JDK-8156217 webrev: http://cr.openjdk.java.net/~alexsch/8156217/webrev.00 This is the second part of the fix related to the fact that char width can be fractional in user space.