Bug 494453 - [HiDPI] Update Javadocs that talk about pixels to points
Summary: [HiDPI] Update Javadocs that talk about pixels to points
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.6   Edit
Hardware: All All
: P3 trivial (vote)
Target Milestone: 4.10   Edit
Assignee: Niraj Modi CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 534932 538680 541631
  Show dependency tree
 
Reported: 2016-05-24 11:59 EDT by Markus Keller CLA
Modified: 2018-12-03 02:18 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Keller CLA 2016-05-24 11:59:11 EDT
Many SWT Javadocs still talk about pixels (e.g. TextLayout#setAscent(int)).

Most of these should be changed to talk about points. Note that some APIs e.g. in class Image really mean pixels (either coordinates in native pixels, or in contexts such as "transparentPixel").

Other APIs like ImageDataProvider and ImageFileNameProvider talk about "physical monitor pixel" and "SWT logical pixel". The latter should be called "SWT logical point".

Regex to find where "pixel" is mentioned in a comment:

^\s*(\*|/\*).*pixel
Comment 1 Niraj Modi CLA 2018-05-17 10:29:39 EDT
Moving to 4.9
Comment 2 Niraj Modi CLA 2018-09-04 08:45:03 EDT
Below are few methods, which have Pixel in the method name. Converting Pixel to Point may cause some confusion here:
StyledText#getHorizontalPixel()
StyledText#getLinePixel()
StyledText#getTopPixel()

In below the point seems little overloaded either to mean Point(class) or point:
Point CoolItem#getMinimumSize()
CoolItem#setMinimumSize(Point)

Apart from above, public APIs in GLData class using pixel need to be evaluated.

Few of the above can be addressed by changing 'Pixel' to 'SWT logical Point', but then this has to be done through-out the SWT APIs for consistency.
Suggest to defer this bug to 4.10 for further discussion.
Comment 3 Niraj Modi CLA 2018-10-23 03:20:19 EDT
Targeting for 4.10 M3
Comment 4 Eclipse Genie CLA 2018-10-23 03:21:15 EDT
New Gerrit change created: https://git.eclipse.org/r/131350
Comment 6 Eclipse Genie CLA 2018-10-30 05:04:55 EDT
New Gerrit change created: https://git.eclipse.org/r/131632
Comment 8 Niraj Modi CLA 2018-11-16 03:14:48 EST
Will do a one more pass over the code base then will run the JavaDoc bash part to update other platforms.
Comment 9 Niraj Modi CLA 2018-12-03 02:18:02 EST
(In reply to Niraj Modi from comment #8)
> Will do a one more pass over the code base then will run the JavaDoc bash
> part to update other platforms.

Did a final pass over the code, no more changes needed in SWT API JavaDocs.
Note: w.r.t. to 'pixel', there still exists entries on below places:
- code comments
- methods signature in which term 'pixel' is used

Copying of the 'point' to 'pixel' changes to other platform code will be taken care by JavaDoc basher via bug 541631

Resolving this bug now.