Browse Source

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.
7.0
jean-pierre charras 3 years ago
parent
commit
d4feb59ed9
  1. 12
      common/gal/opengl/opengl_gal.cpp
  2. 1
      pcb_calculator/calculator_panels/panel_cable_size.cpp

12
common/gal/opengl/opengl_gal.cpp

@ -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.
}

1
pcb_calculator/calculator_panels/panel_cable_size.cpp

@ -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;

Loading…
Cancel
Save