Performance issue |
Post Reply |
Author | ||
cluster
Groupie Joined: 22 January 2015 Status: Offline Points: 91 |
Post Options
Thanks(0)
Posted: 29 April 2015 at 9:48am |
|
Hi Support Team,
I have a question concerning CXTPTrackControlItem::Draw from line 191 to 233: There are 2 "for loops" with the same content. That means you draw all blocks twice. Why? Another performance question: You draw all blocks in a row no matter if they are visible or not. Would it not be preferable if you check if the blocks are out of visible range. Thanks |
||
Fredrik
Senior Member Joined: 22 June 2005 Status: Offline Points: 235 |
Post Options
Thanks(0)
|
|
I think you are missing that the first loop executes when:
and the other loop when:
|
||
Windows 10, Visual Studio 20157, Toolkit Pro 18.3.0
|
||
cluster
Groupie Joined: 22 January 2015 Status: Offline Points: 91 |
Post Options
Thanks(0)
|
|
oh yes, you are right! sorry! I have checked it several times but I didn't see it.
and with the other issue I have put this lines in the Draw function CMy_XTPTrackBlock::Draw(CDC* pDC, CRect rc, BOOL bSelected) ... // Add to increase performance CRect rcVisible(rc); // ---- end---- rc.left = pTrackControl->PositionToTrack(m_nPosition); rc.right = pTrackControl->PositionToTrack(m_nPosition + m_nLength); // Add to increase performance if(rc.left > rcVisible.right || rc.right < rcVisible.left) { m_rcBlock = rc; return 0; } // ---- end---- ... |
||
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |