Shadow color for header?

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
znakeeye
Newbie
Newbie
Posts: 44
Joined: Mon Jan 07, 2013 12:00 am

Shadow color for header?

Post by znakeeye » Sat Mar 02, 2013 10:35 pm

http://stackoverflow.com/questions/1414 ... n-teechart

TJ71016479

Will this be added in the maintenance release? This feature is very important for me!

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Shadow color for header?

Post by Yeray » Tue Mar 05, 2013 9:24 am

Hello,

I've revised it and I found a fix for it. So yes, the next maintenance release will include this fix.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

znakeeye
Newbie
Newbie
Posts: 44
Joined: Mon Jan 07, 2013 12:00 am

Re: Shadow color for header?

Post by znakeeye » Tue Mar 12, 2013 10:21 pm

Could you please share the patch for this bug?

znakeeye
Newbie
Newbie
Posts: 44
Joined: Mon Jan 07, 2013 12:00 am

Re: Shadow color for header?

Post by znakeeye » Tue Mar 12, 2013 10:37 pm

This is what I came up with. Correct?

Code: Select all

protected void drawString(int x, int y, final String text, final ChartBrush brush) {
		
		// FIX:
		Paint fontPaint = brush.getPaint();
		fontPaint.setTextSize(font.getSize() * (float)(chart.getAspect().getFontZoom() * 0.01));
		// Paint fontPaint = font.getPaint((float) (chart.getAspect().getFontZoom() * 0.01));

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Shadow color for header?

Post by Yeray » Wed Mar 13, 2013 11:19 am

Hello,

The fix I applied was a bit different but your suggestion looks better to me. The next maintenance release will include it.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

znakeeye
Newbie
Newbie
Posts: 44
Joined: Mon Jan 07, 2013 12:00 am

Re: Shadow color for header?

Post by znakeeye » Wed Mar 13, 2013 8:05 pm

I'm wondering if you should also set these:

fontPaint.setTypeface(font.getTypeFace()); // getTypeFace() needs to be implemented
fontPaint.setUnderlineText(font.getUnderline());
fontPaint.setStrikeThruText(font.getStrikeout());

Yeray
Site Admin
Site Admin
Posts: 9514
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Shadow color for header?

Post by Yeray » Mon Mar 18, 2013 1:40 pm

Hello,

Right, the fix you suggested breaks these properties.
The fix I initially used doesn't, so it could be better to use it:

Code: Select all

	protected void drawString(int x, int y, final String text, final ChartBrush brush) {
		final Paint fontPaint = font.getPaint((float) (chart.getAspect().getFontZoom() * 0.01));
		
		fontPaint.getTextBounds(text, 0, text.length(), textBounds);
		textSize.width=textBounds.width()+2;
		textSize.height=getFontHeight();

		//TJ71016479
		if (fontPaint.getColor() != brush.getColor().getRGB())
			fontPaint.setColor(brush.getColor().getRGB());
		//...
	}
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply