[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: pcb.git: branch: master updated (ade3ba088e79f52dc9e44fb529276e14b3f08d62)



The branch, master has been updated
  discards  bc9cd3b5ecf2b51931baef22e730bf69d898eb15 (commit)
       via  ade3ba088e79f52dc9e44fb529276e14b3f08d62 (commit)
      from  bc9cd3b5ecf2b51931baef22e730bf69d898eb15 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


=========
 Summary
=========



=================
 Commit Messages
=================

commit ade3ba088e79f52dc9e44fb529276e14b3f08d62
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Revert "Change change.c to treat text scale as mils" and fix harder..
    
    This reverts commit 9396377717f7c49cf38d753a35e32d004294b09e and
    fixes what was probably the underlying issue... I made a mistake in
    commit 2d21a8ad8f38e07b17450450a096f1ce4b3bef0e such that it added
    the existing text scale when setting an "absolute" text size, but
    ignored it when setting a relative change. (Clearly backwards).
    
    Additionally, I've switched to computing the new value in double
    arithmetic to avoid a potential overflow when the input value is
    large and we are using a 32-bit Coord type.
    
    See commit 2d21a8ad8f38e07b17450450a096f1ce4b3bef0e for a description
    of how text scale is defined and used. If we want to change how our
    text is sized / scaled in the future, we would need to change usage
    in many more places than the reverted commit touched.

:100644 100644 eca110e... 61cb335... M	src/change.c

=========
 Changes
=========

commit ade3ba088e79f52dc9e44fb529276e14b3f08d62
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>

    Revert "Change change.c to treat text scale as mils" and fix harder..
    
    This reverts commit 9396377717f7c49cf38d753a35e32d004294b09e and
    fixes what was probably the underlying issue... I made a mistake in
    commit 2d21a8ad8f38e07b17450450a096f1ce4b3bef0e such that it added
    the existing text scale when setting an "absolute" text size, but
    ignored it when setting a relative change. (Clearly backwards).
    
    Additionally, I've switched to computing the new value in double
    arithmetic to avoid a potential overflow when the input value is
    large and we are using a 32-bit Coord type.
    
    See commit 2d21a8ad8f38e07b17450450a096f1ce4b3bef0e for a description
    of how text scale is defined and used. If we want to change how our
    text is sized / scaled in the future, we would need to change usage
    in many more places than the reverted commit touched.

diff --git a/src/change.c b/src/change.c
index eca110e..61cb335 100644
--- a/src/change.c
+++ b/src/change.c
@@ -128,8 +128,8 @@ static void *ChangePolyClear (LayerTypePtr, PolygonTypePtr);
 /* ---------------------------------------------------------------------------
  * some local identifiers
  */
-static Coord Delta;		/* change of size */
-static Coord Absolute;		/* Absolute size */
+static int Delta;		/* change of size */
+static int Absolute;		/* Absolute size */
 static char *NewName;		/* new name */
 static ObjectFunctionType ChangeSizeFunctions = {
   ChangeLineSize,
@@ -838,8 +838,9 @@ ChangeArcClearSize (LayerTypePtr Layer, ArcTypePtr Arc)
 static void *
 ChangeTextSize (LayerTypePtr Layer, TextTypePtr Text)
 {
-  int value = Absolute ? COORD_TO_MIL (Absolute)
-                       : Text->Scale + COORD_TO_MIL (Delta);
+  int value = (Absolute != 0 ? 0 : Text->Scale) +
+              (double)(Absolute != 0 ? Absolute : Delta)
+                / (double)FONT_CAPHEIGHT * 100.;
 
   if (TEST_FLAG (LOCKFLAG, Text))
     return (NULL);
@@ -914,8 +915,9 @@ ChangeElementSize (ElementTypePtr Element)
 static void *
 ChangeElementNameSize (ElementTypePtr Element)
 {
-  int value = Absolute ? COORD_TO_MIL (Absolute)
-                  : DESCRIPTION_TEXT (Element).Scale + COORD_TO_MIL (Delta);
+  int value = (Absolute != 0 ? 0 : DESCRIPTION_TEXT (Element).Scale) +
+              (double)(Absolute != 0 ? Absolute : Delta)
+                / (double)FONT_CAPHEIGHT * 100.;
 
   if (TEST_FLAG (LOCKFLAG, &Element->Name[0]))
     return (NULL);




_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs