Modify

Opened 4 years ago

Closed 4 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 4 years ago.
13375.png (2.0 KB) - added by michael2402 4 years ago.
jumps.gif (264.7 KB) - added by Klumbumbus 4 years ago.
unsharpiconbox.png (1.9 KB) - added by Klumbumbus 4 years ago.
patch-test-icon-rendering.patch (4.1 KB) - added by michael2402 4 years ago.

Download all attachments as: .zip

Change History (17)

Changed 4 years ago by michael2402

Changed 4 years ago by michael2402

Attachment: 13375.png added

comment:1 Changed 4 years ago by michael2402

Description: modified (diff)

comment:2 Changed 4 years ago by Don-vip

Milestone: 16.08

comment:3 Changed 4 years ago by Don-vip

Keywords: regression added
Type: enhancementdefect

comment:4 Changed 4 years ago by Don-vip

Resolution: fixed
Status: newclosed

In 10842/josm:

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

comment:5 Changed 4 years ago by Klumbumbus

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

comment:6 Changed 4 years ago by Klumbumbus

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.


Changed 4 years ago by Klumbumbus

Attachment: jumps.gif added

Changed 4 years ago by Klumbumbus

Attachment: unsharpiconbox.png added

comment:7 Changed 4 years ago by Klumbumbus

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 Changed 4 years ago by Klumbumbus

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 Changed 4 years ago by Don-vip

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

Changed 4 years ago by michael2402

comment:10 Changed 4 years ago by michael2402

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 Changed 4 years ago by skyper

Summary: Fix icon rendering[Patch] Fix icon rendering

comment:12 Changed 4 years ago by Don-vip

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.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.