← Back to team overview

kicad-developers team mailing list archive

[PATCH] About 'too small to see text'

 

Zooming around a crowded schematic I wondered about all the text which
was plotted yet can't be read (since it's too small); this also gives an
idea on how sad is the performance of my workstation:P

In fact, in drawtxt there's already such a check, altough
misformulated...

A patch worth more than a thousand words:

=== modified file 'common/drawtxt.cpp'
--- common/drawtxt.cpp  2012-05-03 18:37:56 +0000
+++ common/drawtxt.cpp  2012-05-22 13:25:48 +0000
@@ -347,7 +347,7 @@
 
     /* if a text size is too small, the text cannot be drawn, and it is drawn as a single
      * graphic line */
-    if( ABS( aSize.x ) < 3 )
+    if( aDC && aDC->LogicalToDeviceYRel( ABS( aSize.y ) ) < 8 )
     {
         /* draw the text as a line always vertically centered */
         wxPoint end( current_char_pos.x + dx, current_char_pos.y );

The check on the size is done in *user* units (mils for eeschema,
whatever for the other programs). Legibility is determined by the zoom
level (which is handled by the DC), so just ask it the effective size (8
is of course an arbitrarily determined value in pixels...). Exactly like
the "Greek Text below # pixels" in Adobe reader.

IMHO is better a rectangle instead of a line, but that's a personal
preference thing...

-- 
Lorenzo Marcantonio
Logos Srl


Follow ups