[pcb] Bug fixes L#882712 L#699307 L#891041

Chitlesh GOORAH chitlesh at fedoraproject.org
Mon Nov 28 21:43:13 UTC 2011


commit 56265f3552d9a2bbcfb70590007ac3418866ef8f
Author: Chitlesh GOORAH <chitlesh at fedoraproject.org>
Date:   Mon Nov 28 22:42:56 2011 +0100

    Bug fixes L#882712 L#699307 L#891041

 0001-Fix-parsing-of-route-styles-with-units.patch  |   38 ++++++++++++
 ...ome-instances-of-an-int-being-used-in.patch.txt |   61 ++++++++++++++++++++
 L-699307-mouse_scrolllbar.patch                    |   15 +++++
 pcb.spec                                           |   38 +++++++++++-
 4 files changed, 148 insertions(+), 4 deletions(-)
---
diff --git a/0001-Fix-parsing-of-route-styles-with-units.patch b/0001-Fix-parsing-of-route-styles-with-units.patch
new file mode 100644
index 0000000..d66b49a
--- /dev/null
+++ b/0001-Fix-parsing-of-route-styles-with-units.patch
@@ -0,0 +1,38 @@
+From ab7925afcc051d42a181bcfb87289b53aa37a935 Mon Sep 17 00:00:00 2001
+From: Richard Barlow <richard at richardbarlow.co.uk>
+Date: Sat, 12 Nov 2011 01:41:47 +0000
+Subject: [PATCH] Fix parsing of route styles with units
+
+A bug appeared after route styles started being saved with units
+suffixed. When loading a PCB file the units were ignored and therefore
+it was assumed the values were in cmils.
+
+This was a problem in the get_unit_struct() function which didn't handle
+long strings well. If the unit was followed by more characters strcmp
+would return non-zero. The function has already worked out the length of
+the unit text and therefore strncmp should be used.
+---
+ src/pcb-printf.c |    6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/pcb-printf.c b/src/pcb-printf.c
+index c57a570..f687e06 100644
+--- a/src/pcb-printf.c
++++ b/src/pcb-printf.c
+@@ -182,10 +182,10 @@ const Unit *get_unit_struct (const char *const_suffix)
+     }
+ 
+   /* Do lookup */
+-  if (*suffix)
++  if (*suffix && s_len > 0)
+     for (i = 0; i < N_UNITS; ++i)
+-      if (strcmp (suffix, Units[i].suffix) == 0 ||
+-          strcmp (suffix, Units[i].alias[0]) == 0)
++      if (strncmp (suffix, Units[i].suffix, s_len) == 0 ||
++          strncmp (suffix, Units[i].alias[0], s_len) == 0)
+         {
+           g_free (m_suffix);
+           return &Units[i];
+-- 
+1.7.4.4
+
diff --git a/0001-png-hid-fixed-some-instances-of-an-int-being-used-in.patch.txt b/0001-png-hid-fixed-some-instances-of-an-int-being-used-in.patch.txt
new file mode 100644
index 0000000..2e35d18
--- /dev/null
+++ b/0001-png-hid-fixed-some-instances-of-an-int-being-used-in.patch.txt
@@ -0,0 +1,61 @@
+From ebb88edf2ef53903980244f44fe891e49d60fb76 Mon Sep 17 00:00:00 2001
+From: Dima Kogan <dima at secretsauce.net>
+Date: Wed, 16 Nov 2011 01:01:06 -0800
+Subject: [PATCH] png hid: fixed some instances of an 'int' being used instead
+ of Coord.
+
+After the unit switch, some cases where an int has sufficed previously no longer
+work. An example is png output of tilted, square pads. Before this patch those
+pads do not get drawn correctly; their size is completely wrong.
+---
+ src/hid/png/png.c |   17 ++++++++++-------
+ 1 files changed, 10 insertions(+), 7 deletions(-)
+
+diff --git a/src/hid/png/png.c b/src/hid/png/png.c
+index f00d407..ff8931a 100644
+--- a/src/hid/png/png.c
++++ b/src/hid/png/png.c
+@@ -70,7 +70,7 @@ static int show_solder_side;
+ #define SCALE(w)   ((int)((w)/scale + 0.5))
+ #define SCALE_X(x) ((int)(((x) - x_shift)/scale))
+ #define SCALE_Y(y) ((int)(((show_solder_side ? (PCB->MaxHeight-(y)) : (y)) - y_shift)/scale))
+-#define SWAP_IF_SOLDER(a,b) do { int c; if (show_solder_side) { c=a; a=b; b=c; }} while (0)
++#define SWAP_IF_SOLDER(a,b) do { Coord c; if (show_solder_side) { c=a; a=b; b=c; }} while (0)
+ 
+ /* Used to detect non-trivial outlines */
+ #define NOT_EDGE_X(x) ((x) != 0 && (x) != PCB->MaxWidth)
+@@ -634,8 +634,9 @@ png_do_export (HID_Attr_Val * options)
+   int save_ons[MAX_LAYER + 2];
+   int i;
+   BoxType *bbox;
+-  int w, h;
+-  int xmax, ymax, dpi;
++  Coord w, h;
++  Coord xmax, ymax;
++  int dpi;
+   const char *fmt;
+   bool format_error = false;
+ 
+@@ -1493,13 +1494,15 @@ png_draw_line (hidGC gc, Coord x1, Coord y1, Coord x2, Coord y2)
+        * it as a filled polygon.
+        */
+       int fg = gdImageColorResolve (im, gc->color->r, gc->color->g,
+-				    gc->color->b),
+-	w = gc->width, dx = x2 - x1, dy = y2 - y1, dwx, dwy;
++				    gc->color->b);
++      Coord w = gc->width;
++      Coord dwx, dwy;
++
+       gdPoint p[4];
+-      double l = sqrt (dx * dx + dy * dy) * 2;
++      double l = Distance(x1, y1, x2, y2) * 2;
+ 
+       w += 2 * bloat;
+-      dwx = -w / l * dy; dwy =  w / l * dx;
++      dwx = -w / l * (y2 - y1); dwy =  w / l * (x2 - x1);
+       p[0].x = SCALE_X (x1 + dwx - dwy); p[0].y = SCALE_Y(y1 + dwy + dwx);
+       p[1].x = SCALE_X (x1 - dwx - dwy); p[1].y = SCALE_Y(y1 - dwy + dwx);
+       p[2].x = SCALE_X (x2 - dwx + dwy); p[2].y = SCALE_Y(y2 - dwy - dwx);
+-- 
+1.7.7
+
diff --git a/L-699307-mouse_scrolllbar.patch b/L-699307-mouse_scrolllbar.patch
new file mode 100644
index 0000000..1220c17
--- /dev/null
+++ b/L-699307-mouse_scrolllbar.patch
@@ -0,0 +1,15 @@
+X-Git-Url: http://git.gpleda.org/?p=pcb.git;a=blobdiff_plain;f=src%2Fhid%2Fgtk%2Fgtkhid-main.c;h=a83ee2efc54d1bd2703b3e1fa2f6a69dcce7ec48;hp=9b239e1069855af4240314775ba031825c1449e2;hb=ed9a9d0cd9d054e6fc4a075ec1b8d9a12f1cb376;hpb=cd3bd7f15384402983e71c6673678ce614a3898f
+
+diff --git a/src/hid/gtk/gtkhid-main.c b/src/hid/gtk/gtkhid-main.c
+index 9b239e1..a83ee2e 100644
+--- a/src/hid/gtk/gtkhid-main.c
++++ b/src/hid/gtk/gtkhid-main.c
+@@ -2030,7 +2030,7 @@ HID_Action ghid_main_action_list[] = {
+   {"LayerGroupsChanged", 0, LayerGroupsChanged},
+   {"LibraryChanged", 0, LibraryChanged},
+   {"Load", 0, Load},
+-  {"Pan", N_("Click on a place to pan"), PanAction, pan_help, pan_syntax},
++  {"Pan", 0, PanAction, pan_help, pan_syntax},
+   {"PCBChanged", 0, PCBChanged},
+   {"PointCursor", 0, PointCursor},
+   {"Popup", 0, Popup, popup_help, popup_syntax},
diff --git a/pcb.spec b/pcb.spec
index 3e5e5cb..dfec959 100644
--- a/pcb.spec
+++ b/pcb.spec
@@ -1,8 +1,9 @@
+
 %global         pcbver    20110918
 
 Name:           pcb
 Version:        0.%{pcbver}
-Release:        1%{?dist}
+Release:        2%{?dist}
 
 Summary:        An interactive printed circuit board editor
 License:        GPLv2
@@ -23,6 +24,19 @@ Requires:       electronics-menu
 
 Source0:        http://downloads.sourceforge.net/sourceforge/%{name}/%{name}-%{pcbver}.tar.gz
 
+# L#882712 Route styles are not properly loaded after nm conversion
+# Affected 0.20110918, reported on 2011-10-27
+Patch0:         0001-Fix-parsing-of-route-styles-with-units.patch
+
+# L#699307 Panning problem when mouse button is released on scrollbar (sf-2923335)
+# Affected 0.20110918, patch from upstream's git repo, reported 2009-12-30
+Patch1:         L-699307-mouse_scrolllbar.patch
+
+# L#891041 PNG export broken for tilted, square pads
+# Affected 0.20110918, reported on 2011-11-16 - Upstream has been patched on 2011-11-20
+Patch2:         0001-png-hid-fixed-some-instances-of-an-int-being-used-in.patch.txt
+
+
 
 %description
 PCB is an interactive printed circuit board editor.
@@ -32,6 +46,10 @@ output for use in the board fabrication and assembly process. PCB offers
 high end features such as an autorouter and trace optimizer which can
 tremendously reduce layout time.
 
+# rpmlint warnings ignored:
+# pcb.src: W: spelling-error %description -l en_US centroid -> centrist
+# pcb.src: W: spelling-error %description -l en_US autorouter -> auto router, auto-router, autoworker
+
 
 %package doc
 Summary:         Documentation for PCB, An interactive printed circuit board editor
@@ -41,7 +59,7 @@ Requires(post):  info
 Requires(preun): info
 
 %description doc
-This package contains the documentation of PCB, An interactive printed circuit
+This package contains the documentation of PCB, an interactive printed circuit
 board editor.
 
 
@@ -56,6 +74,10 @@ board editor.
    's|tutdir = $(pkgdatadir)/tutorial|tutdir = @docdir@/tutorial|' \
    tutorial/Makefile.*
 
+%patch0 -p1 -b -L882712
+%patch1 -p1 -b -L699307
+%patch2 -p1 -b -L891041
+
 %build
 export WISH=%{_bindir}/wish
 
@@ -135,12 +157,16 @@ mv %{buildroot}%{_docdir}/%{name}-%{version}/refcard.pdf %{buildroot}%{_docdir}/
 # remove duplicates
 %{__rm} -f %{buildroot}%{_bindir}/Merge*
 
+# L#854396 0.20110918 needlessly installs gts static library & header file
+%{__rm} -f %{buildroot}%{_libdir}/libgts.a %{buildroot}%{_includedir}/gts.h
+
 # locale's
 %find_lang %{name}
 
 
 #check
 #{__make} check
+# L#860037 0.20100929 hid_png3 test fails on i386 arch
 # 2011-11-12 FAILED:  See outputs/hid_png3/mismatch
 
 %clean
@@ -201,12 +227,16 @@ fi
 %{_datadir}/mime/packages/pcb.xml
 %{_datadir}/mimelnk/application/x-*.desktop
 %{_datadir}/gEDA/scheme/gnet-pcbfwd.scm
-%{_libdir}/libgts.a
-%{_includedir}/gts.h
+
 
 
 
 %changelog
+* Sun Nov 27 2011 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20110918-2
+- Bug fix L#882712 Route styles are not properly loaded after nm conversion
+- Bug fix L#699307 Panning problem when mouse button is released on scrollbar (sf-2923335)
+- Bug fix L#891041 png export broken for tilted, square pads
+
 * Sat Nov 12 2011 Chitlesh Goorah <chitlesh [AT] fedoraproject DOT org> - 0.20110918-1
 - New upstream release
 


More information about the scm-commits mailing list