Modify

Opened 8 years ago

Closed 8 years ago

#13375 closed defect (fixed)

[Patch] Fix icon rendering

Reported by: michael2402 Owned by: michael2402
Priority: normal Milestone: 16.08
Component: Core mappaint Version:
Keywords: gsoc-core regression Cc: Don-vip, bastiK, stoecker

Description (last modified by michael2402)

[10827] introduced a bug where the coordinates were not computed correctly.

I fixed the sign error and also made the selection box rotate with the image (it looked odd if the image is rotated and that box is not).


Attachments (5)

patch-fix-mappaint-icons.patch (1.4 KB ) - added by michael2402 8 years ago.
13375.png (2.0 KB ) - added by michael2402 8 years ago.
jumps.gif (264.7 KB ) - added by Klumbumbus 8 years ago.
unsharpiconbox.png (1.9 KB ) - added by Klumbumbus 8 years ago.
patch-test-icon-rendering.patch (4.1 KB ) - added by michael2402 8 years ago.

Download all attachments as: .zip

Change History (17)

by michael2402, 8 years ago

by michael2402, 8 years ago

Attachment: 13375.png added

comment:1 by michael2402, 8 years ago

Description: modified (diff)

comment:2 by Don-vip, 8 years ago

Milestone: 16.08

comment:3 by Don-vip, 8 years ago

Keywords: regression added
Type: enhancementdefect

comment:4 by Don-vip, 8 years ago

Resolution: fixed
Status: newclosed

In 10842/josm:

fix #13375 - Fix icon rendering (patch by michael2402) - gsoc-core

comment:5 by Klumbumbus, 8 years ago

Ticket #13377 has been marked as a duplicate of this ticket.

comment:6 by Klumbumbus, 8 years ago

Resolution: fixed
Status: closedreopened

The rendering is a bit buggy. See the following screencast. First I zoom with the keyboard and then with the mouse. See how the icon jumps around in the red box. Also the text changes its position.


by Klumbumbus, 8 years ago

Attachment: jumps.gif added

by Klumbumbus, 8 years ago

Attachment: unsharpiconbox.png added

comment:7 by Klumbumbus, 8 years ago

Another problem is that the icon box is unsharp. However I alreaedy noticed this before r10827 on high zoom levels. Now it seems it is always unsharp.


comment:8 by Klumbumbus, 8 years ago

URL:http://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2016-08-18 19:51:12 +0200 (Thu, 18 Aug 2016)
Build-Date:2016-08-18 17:56:08
Revision:10842
Relative:URL: ^/trunk

Identification: JOSM/1.5 (10842 de) Windows 7 32-Bit
Memory Usage: 384 MB / 742 MB (88 MB allocated, but free)
Java version: 1.8.0_101-b13, Oracle Corporation, Java HotSpot(TM) Client VM
VM arguments: [-Djava.security.manager, -Djava.security.policy=file:<java.home>\lib\security\javaws.policy, -DtrustProxy=true, -Djnlpx.home=<java.home>\bin, -Djnlpx.origFilenameArg=C:\Program Files\josm-latest-bla.jnlp, -Djnlpx.remove=false, -Djava.util.Arrays.useLegacyMergeSort=true, -Djnlpx.heapsize=256m,768m, -Djnlpx.splashport=63865, -Djnlpx.jvm=<java.home>\bin\javaw.exe, -Djnlpx.vmargs=LURqYXZhLnV0aWwuQXJyYXlzLnVzZUxlZ2FjeU1lcmdlU29ydD10cnVlAA==]
Dataset consistency test: No problems found
}}

comment:9 by Don-vip, 8 years ago

Owner: changed from team to michael2402
Status: reopenednew
Summary: [Patch] Fix icon rendering.Fix icon rendering

by michael2402, 8 years ago

comment:10 by michael2402, 8 years ago

The problem is with how we define the center / position of objects.

The definition currently used is:

  • Center is exactly the middle of the map view
  • Objects are placed on the exact position, if they are between two pixel, antialiasing gives us that nice line

The jumping during zoom is caused by rounding problems: (int) rounds towards zero. Since some parts of the code are using translated coordinates, we may get differences there. After switching that to Math.round(), I still got flickering images. This was caused by the map view center not being aligned to a pixel (map view has an odd width/height).

I changed the zoom code to not use the exact center but a center close to the exact one. The component still aligns to the exact center. So if you move the window around, rounding errors caused by this will not sum up.

I attached the patch, it should fix the issue. I have not had time to test if it works in all zoom situations.

comment:11 by skyper, 8 years ago

Summary: Fix icon rendering[Patch] Fix icon rendering

comment:12 by Don-vip, 8 years ago

Resolution: fixed
Status: newclosed

In 10856/josm:

fix #13375 - Fix icon rendering (patch by michael2402) - gsoc-core + add unit test

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain michael2402.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.