Reduce the size of the tuning popups.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/16304
This commit is contained in:
parent
c5d0dcdb15
commit
e3c9cf94b7
|
@ -68,8 +68,8 @@ KIGFX::PREVIEW::TEXT_DIMS KIGFX::PREVIEW::GetConstantGlyphHeight( KIGFX::GAL* aG
|
|||
int aRelativeSize )
|
||||
{
|
||||
constexpr double aspectRatio = 1.0;
|
||||
constexpr double hdpiSizes[] = { 8, 9, 11, 13, 15 };
|
||||
constexpr double sizes[] = { 10, 12, 14, 16, 18 };
|
||||
constexpr double hdpiSizes[] = { 6, 8, 9, 11, 13, 14, 16 };
|
||||
constexpr double sizes[] = { 8, 10, 12, 14, 15, 16, 18 };
|
||||
|
||||
double height;
|
||||
double thicknessFactor;
|
||||
|
@ -80,14 +80,14 @@ KIGFX::PREVIEW::TEXT_DIMS KIGFX::PREVIEW::GetConstantGlyphHeight( KIGFX::GAL* aG
|
|||
|
||||
if( canvas && canvas->GetScaleFactor() > 1 )
|
||||
{
|
||||
height = hdpiSizes[ 2 + aRelativeSize ];
|
||||
height = hdpiSizes[ 3 + aRelativeSize ];
|
||||
thicknessFactor = 0.15;
|
||||
shadowFactor = 0.10;
|
||||
linePitchFactor = 1.7;
|
||||
}
|
||||
else
|
||||
{
|
||||
height = sizes[ 2 + aRelativeSize ];
|
||||
height = sizes[ 3 + aRelativeSize ];
|
||||
thicknessFactor = 0.20;
|
||||
shadowFactor = 0.15;
|
||||
linePitchFactor = 1.9;
|
||||
|
|
|
@ -143,14 +143,14 @@ public:
|
|||
gal->PushDepth();
|
||||
gal->SetLayerDepth( gal->GetMinDepth() );
|
||||
|
||||
KIGFX::PREVIEW::TEXT_DIMS headerDims = KIGFX::PREVIEW::GetConstantGlyphHeight( gal, -2 );
|
||||
KIGFX::PREVIEW::TEXT_DIMS textDims = KIGFX::PREVIEW::GetConstantGlyphHeight( gal, -1 );
|
||||
KIGFX::PREVIEW::TEXT_DIMS headerDims = KIGFX::PREVIEW::GetConstantGlyphHeight( gal, -3 );
|
||||
KIGFX::PREVIEW::TEXT_DIMS textDims = KIGFX::PREVIEW::GetConstantGlyphHeight( gal, -2 );
|
||||
KIFONT::FONT* font = KIFONT::FONT::GetFont();
|
||||
const KIFONT::METRICS& fontMetrics = KIFONT::METRICS::Default();
|
||||
TEXT_ATTRIBUTES textAttrs;
|
||||
|
||||
int glyphWidth = textDims.GlyphSize.x;
|
||||
VECTOR2I margin( glyphWidth / 2, glyphWidth );
|
||||
VECTOR2I margin( KiROUND( glyphWidth * 0.4 ), KiROUND( glyphWidth * 0.9 ) );
|
||||
VECTOR2I size( glyphWidth * 25 + margin.x * 2, headerDims.GlyphSize.y + textDims.GlyphSize.y );
|
||||
VECTOR2I offset( margin.x * 2, -( size.y + margin.y * 2 ) );
|
||||
|
||||
|
@ -210,7 +210,7 @@ public:
|
|||
textAttrs.m_StrokeWidth = textDims.StrokeWidth;
|
||||
|
||||
textPos = GetPosition() + offset;
|
||||
textPos.y += KiROUND( headerDims.LinePitch * 1.2 );
|
||||
textPos.y += KiROUND( headerDims.LinePitch * 1.3 );
|
||||
font->Draw( gal, m_currentText, textPos, textAttrs, KIFONT::METRICS::Default() );
|
||||
|
||||
textPos.x += glyphWidth * 11 + margin.x;
|
||||
|
|
Loading…
Reference in New Issue