In wxSFLineShape i've changed the visibility of the members m-nSrcOffset and m-nTrgOffset to protected. I'm using my own data model and need access to them for saving and restoring.
The wxSFScaledDC has problems with small font sizes. Here's a fix:
Hi, thank you for the feedback. I've implemented requested changes in SVN 248. Your patch couldn't be applied as it is because you cannot draw texts if used font is NULL (at least on some supported platforms) but now the used font cannot be smaller than 1pt.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i've discovered a performance issue, when creating many shapes. My project creates 200 shapes. Most of the time (92%) is spent in the function wxXmlSerializer::GetNewId().
GetNewId() makes a linear search and calls IsIdUsed() which calls GetIDCount(). GetIDCount() makes a linear search over all shapes again. The generation of the 200. ID iterates over 40.000 shapes.
It's not urgent, perhaps you can implement a better algorithm some time.
But in general the wxShapeFramework is a very nice thing.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I've implemented completely new approach for IDs' handling (IDs are stored in map containing also pointer to owners now) so the performance of all ID's related functions should be much higher now. Please, test the latest SVN (249) and let me know whether it helped you. Thank you. M.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
these speed changes are a very good improvement thanks heaps, as the app I am creating needs to scale to large numbers of shapes/lines. This change makes at least a fourfold improvement on my slow test system!
The other changes/additions in SVN249 and in v1.80 are also greatly appreciated - your libraries are rapidly maturing!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
some suggestions for the next release:
In wxSFLineShape i've changed the visibility of the members m-nSrcOffset and m-nTrgOffset to protected. I'm using my own data model and need access to them for saving and restoring.
The wxSFScaledDC has problems with small font sizes. Here's a fix:
void wxSFScaledDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
{
if( m_fEnableGC )
{
#if wxUSE_GRAPHICS_CONTEXT
//InitGC();
m_pGC->DrawText( text, x, y );
//UninitGC();
#endif
}
else
{
wxFont font = GetFont();
wxFont prevfont = font;
if(font != wxNullFont)
{
int scaledSize=font.GetPointSize()*m_nScale;
if (scaledSize>0) {
font.SetPointSize(scaledSize);
SetFont(font);
m_pTargetDC->DrawText(text, Scale(x), Scale(y));
}
}
else
m_pTargetDC->DrawText(text, Scale(x), Scale(y));
SetFont(prevfont);
}
}
Regards,
Mathias
Hi, thank you for the feedback. I've implemented requested changes in SVN 248. Your patch couldn't be applied as it is because you cannot draw texts if used font is NULL (at least on some supported platforms) but now the used font cannot be smaller than 1pt.
Hi again,
i've discovered a performance issue, when creating many shapes. My project creates 200 shapes. Most of the time (92%) is spent in the function wxXmlSerializer::GetNewId().
GetNewId() makes a linear search and calls IsIdUsed() which calls GetIDCount(). GetIDCount() makes a linear search over all shapes again. The generation of the 200. ID iterates over 40.000 shapes.
It's not urgent, perhaps you can implement a better algorithm some time.
But in general the wxShapeFramework is a very nice thing.
Hi, I've implemented completely new approach for IDs' handling (IDs are stored in map containing also pointer to owners now) so the performance of all ID's related functions should be much higher now. Please, test the latest SVN (249) and let me know whether it helped you. Thank you. M.
Hi Michal
these speed changes are a very good improvement thanks heaps, as the app I am creating needs to scale to large numbers of shapes/lines. This change makes at least a fourfold improvement on my slow test system!
The other changes/additions in SVN249 and in v1.80 are also greatly appreciated - your libraries are rapidly maturing!