View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002537 | JEDI VCL | 00 JVCL Components | public | 2005-01-21 17:35 | 2005-04-12 07:24 |
Reporter | anonymous | Assigned To | obones | ||
Priority | normal | Severity | tweak | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | |||||
Target Version | Fixed in Version | 3.10 | |||
Summary | 0002537: JvgRuler does not show correct units | ||||
Description | In pixel mode, it's fine. In centimeter mode, it's fine. In inches mode, there's a problem. Based on what I see on the screen, it looks like a simple error in the formula. When showing inches, it appears to be multiplying the cm. value instead of dividing it. The correct setting should be: inches := cm / 2.54 Right now it appears to be set for: inches := cm * 2.54 I'm using 3.00 RC1 | ||||
Tags | No tags attached. | ||||
|
Sounds reasonable. After all, one inch == 2.54 cm (approx.) |
|
I've insvestigated this, and it seems the whole formula is wrong. It gets the Pixels Per Inch value for the screen, and then for an unknown reason multiplies it by 1.541 and divides it by 10. I have no idea why that is, as it should directly use the value from the system without adjustments. After all, if there are 96 pixels per inch, then a ruler of 192 pixels should show 2 inches and not 25 ! I propose to change, in run\JvgUtils the following functions, starting at line 302, by the following code: function InchesToPixels(DC: HDC; Value: Single; IsHorizontal: Boolean): Integer; const LogPixels: array [Boolean] of Integer = (LOGPIXELSY, LOGPIXELSX); begin Result := Round(Value * GetDeviceCaps(DC, LogPixels[IsHorizontal])); end; function CentimetersToPixels(DC: HDC; Value: Single; IsHorizontal: Boolean): Integer; const LogPixels: array [Boolean] of Integer = (LOGPIXELSY, LOGPIXELSX); begin Result := Round(Value * GetDeviceCaps(DC, LogPixels[IsHorizontal])/2.54); end; With this, the ruler seems to be much more logical to me. Could anyone confirm this is alright, so that I can commit those changes? |
|
Well, this is in CVS and since no one complained about it, I'll assume it is resolved. |
Date Modified | Username | Field | Change |
---|---|---|---|
2005-01-21 17:35 | anonymous | New Issue | |
2005-01-22 00:06 |
|
Note Added: 0006240 | |
2005-01-22 06:21 | obones | Note Added: 0006249 | |
2005-01-22 06:21 | obones | Assigned To | => obones |
2005-01-22 06:21 | obones | Status | new => feedback |
2005-04-12 07:24 | obones | Status | feedback => resolved |
2005-04-12 07:24 | obones | Resolution | open => fixed |
2005-04-12 07:24 | obones | Note Added: 0006960 |