pcb

Bug sf-1741659: annoying decimals in coordinates

Bug #699452 reported by Ineiev
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
pcb
Fix Released
Low
Ineiev

Bug Description

This misfix adjusts the labels to grid when applicable.

There is two other ways, reduce the precision output
and process the grid in floating point; the former
makes the labels less useful, the latter would produce
more much more complicated patch.

Tags: sf-patches
Revision history for this message
Ineiev (ineiev) wrote :
Revision history for this message
Felix Ruoff (felixruoff) wrote :

The patch of Ineiev here seems to be newer than the one in LP:699169. It applies and runs without problems on my system, like the patch in the other thread, too. So, I would very welcome, if one of these patches got applied to HEAD soon :-) (The patch will close both bugreports, I think)

Revision history for this message
Peter Clifton (pcjc2) wrote :

Why does the patch have this change?

- ghid_cursor_position_relative_label_set_text ("r __.__; phi __._; __.__ __.__");
+ ghid_cursor_position_relative_label_set_text ("__.__ __._; __.__ __.__");

Other than that, it looks ok to me.

Changed in pcb:
assignee: nobody → Ineiev (ineiev)
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Ineiev (ineiev) wrote :

It is not related to the bug; I thought these letters are not really needed
(in the Lesstif HID they are absent); if you think they are, I'll exclude this change.

Revision history for this message
Peter Clifton (pcjc2) wrote :

Leave the letters as they were.. they add clarity to the meaning of the numbers.

I look forward to the fix.

Revision history for this message
Ineiev (ineiev) wrote :

Ok, I'll leave them; however, in Sept 2009 I discovered a regression in this patch;
I fixed it in my branch on repo.or.cz, but I need to check all again before pushing.

I think I'll do it within a week.

Revision history for this message
Ineiev (ineiev) wrote :

Now, the minimal fix.

The minor problem is loss of precision
in many places (where unprecise constants
for metric-to-imperial conversions and floats
for crosshair calculations are used).

The major problem is absence of any reliable means
to distiguish between metric and non-metric grids
(since Settings.grid_units_mm is really an attribute
of display and doesn't define whether the grid is metric).

Revision history for this message
Ineiev (ineiev) wrote :

This is a testcase (a large board with two pads; the first
one is misaligned with metric grids by one PCB unit,
the second one is misaligned by two PCB units).

Revision history for this message
Felix Ruoff (felixruoff) wrote :

The patch looks fine to me.

But... I have a Problem with the testcase-file: I can select objects/elements/lines, but I can't deselect them! I have also tested this with Version 20091103 (lesstiff GUI and GTK+ GUI) and there is the same Problem (so I think, this Problem is not related to this Patch, but perhaps someone has an idea to fix this!),

Revision history for this message
Ineiev (ineiev) wrote :

Thanks, pushed!

WRT the text selection, it is an unrelated bug: the bounding box is not assigned
correctly for some reason. I was able to "drag" the texts from the centers of the pads
(both before and after applying the patch).

Changed in pcb:
status: Confirmed → Fix Committed
Revision history for this message
Stephen Ecob (silicon-on-inspiration) wrote :

Thank you, the patch makes my life better :)

I notice that it works fine for the absolute coordinates, but the relative coordinates are sometimes still broken - see the attached screenshot. The problem seems to only come up for some positions of the reference mark (set with ctrl-m).
The screenshot was taken with units set to mm and grid set to 0.1mm
PCB built from git head as at [Tue, 22 Mar 2011 20:43:30 +0000]

Revision history for this message
Ineiev (ineiev) wrote :

Thank you, should work now.

Peter Clifton (pcjc2)
Changed in pcb:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.