[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
gEDA-cvs: pcb.git: branch: master updated (bc9cd3b5ecf2b51931baef22e730bf69d898eb15)
The branch, master has been updated
via bc9cd3b5ecf2b51931baef22e730bf69d898eb15 (commit)
via 99ab6b67549dfa144619fcce2a237d78048064a6 (commit)
from bcd0c2cf79bbf3902c6f9c44dd7585fbdb0aa1f7 (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
=========
src/action.c | 7 +++++--
src/change.c | 14 ++++++++------
2 files changed, 13 insertions(+), 8 deletions(-)
=================
Commit Messages
=================
commit bc9cd3b5ecf2b51931baef22e730bf69d898eb15
Author: Andrew Poelstra <asp11@xxxxxx>
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
commit 99ab6b67549dfa144619fcce2a237d78048064a6
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
action.c: Fix the SetValue(TextScale, ...) action after nanometer conversion
:100644 100644 62c53e3... 2a0be9e... M src/action.c
=========
Changes
=========
commit bc9cd3b5ecf2b51931baef22e730bf69d898eb15
Author: Andrew Poelstra <asp11@xxxxxx>
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);
commit 99ab6b67549dfa144619fcce2a237d78048064a6
Author: Peter Clifton <pcjc2@xxxxxxxxx>
Commit: Peter Clifton <pcjc2@xxxxxxxxx>
action.c: Fix the SetValue(TextScale, ...) action after nanometer conversion
diff --git a/src/action.c b/src/action.c
index 62c53e3..2a0be9e 100644
--- a/src/action.c
+++ b/src/action.c
@@ -2173,6 +2173,7 @@ ActionSetValue (int argc, char **argv, Coord x, Coord y)
char *units = ARG (2);
bool absolute; /* flag for 'absolute' value */
double value;
+ int text_scale;
int err = 0;
if (function && val)
@@ -2217,8 +2218,10 @@ ActionSetValue (int argc, char **argv, Coord x, Coord y)
case F_Text:
case F_TextScale:
- value /= 45;
- SetTextScale (absolute ? value : value + Settings.TextScale);
+ text_scale = value / (double)FONT_CAPHEIGHT * 100.;
+ if (!absolute)
+ text_scale += Settings.TextScale;
+ SetTextScale (text_scale);
break;
default:
err = 1;
_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs