OPENGL_GAL, draw bitmap: Rebuild the bitmap cache if the bitmap itself was rotated.

Fixes #12378
https://gitlab.com/kicad/code/kicad/issues/12378
Fix also a Coverity warning.
This commit is contained in:
jean-pierre charras 2022-09-08 11:59:53 +02:00
parent 9523586bf1
commit d4feb59ed9
2 changed files with 10 additions and 3 deletions

View File

@ -113,10 +113,16 @@ GLuint GL_BITMAP_CACHE::RequestBitmap( const BITMAP_BASE* aBitmap )
if( it != m_bitmaps.end() )
{
// A bitmap is found in cache bitmap.
// Ensure the associated texture is still valid (can be destroyed somewhere)
if( glIsTexture( it->second.id ) )
// A bitmap is found in cache bitmap. Ensure the associated texture
// is still valid.
// It can be destroyed somewhere or the corresponding bitmap can be
// modifed (rotated)
if( ( it->second.w == aBitmap->GetSizePixels().x ) &&
( it->second.h == aBitmap->GetSizePixels().y ) &&
glIsTexture( it->second.id ) )
{
return it->second.id;
}
// else if not valid, it will be recreated.
}

View File

@ -104,6 +104,7 @@ PANEL_CABLE_SIZE::PANEL_CABLE_SIZE( wxWindow* parent, wxWindowID id, const wxPoi
m_updatingResistanceDc = false;
m_updatingRVdrop = false;
m_updatingPower = false;
m_updatingConductorMaterialResitivity = false;
m_imperial = false;