Ticket #496 (closed task: fixed)

Opened 4 years ago

Last modified 4 years ago

Fix inconsistent naming of units in stylization

Reported by: waltweltonlair Owned by: waltweltonlair
Priority: high Milestone: 2.1
Component: General Version: 2.0.0
Severity: minor Keywords:
Cc: External ID: 1064832

Description

Stylization code uses terms like "pixels", screen units", and "rendering units" inconsistently, which leads to confusion when working with the code. For example, the SE_Renderer class defines a virtual method named GetPixelsPerMillimeterScreen. This is supposed to return the number of native renderer units per millimeter in device space. For some renderers (AGG, GD) the native units are indeed normal device pixels, but for other renderers (DWF) the native units are W2D units and not pixels.

The SE_Renderer API also defines low level rendering methods: DrawScreenPolyline, DrawScreenText, etc. These take native renderer units as arguments, and hence "screen units" are the native renderer units.

The following changes need to be made:

  • code needs to be updated everywhere to use "screen units" when working with native renderer units
  • the word "pixel" should only be used when referring to actual physical pixels
  • GetPixelsPerMillimeterScreen will be renamed to GetScreenUnitsPerMillimeterDevice
  • GetPixelsPerMillimeterWorld will be renamed to GetScreenUnitsPerMillimeterWorld

Change History

Changed 4 years ago by waltweltonlair

  • status changed from new to assigned

Changed 4 years ago by waltweltonlair

  • status changed from assigned to closed
  • resolution set to fixed

Changed 4 years ago by waltweltonlair

  • external_id set to 1064832

Changed 4 years ago by waltweltonlair

Merged fix into branch stream with submission  https://trac.osgeo.org/mapguide/changeset/3125.

Note: See TracTickets for help on using tickets.