ImagePath: Fixed that the image was not reloaded when changing with !SetOption

This commit is contained in:
Brian Ferguson
2013-06-07 23:45:28 -06:00
parent 136689bcfb
commit f1cb311723
2 changed files with 10 additions and 3 deletions

View File

@ -166,7 +166,8 @@ TintedImage::TintedImage(const WCHAR* name, const WCHAR** optionArray, bool disa
m_Flip(RotateNoneFlipNone),
m_Rotate(),
m_UseExifOrientation(false),
m_MeterWindow(meterWindow)
m_MeterWindow(meterWindow),
m_HasPathChanged(false)
{
}
@ -318,6 +319,7 @@ void TintedImage::LoadImage(const std::wstring& imageName, bool bLoadAlways)
{
std::wstring filename = m_Path + imageName;
if (m_MeterWindow) m_MeterWindow->MakePathAbsolute(filename);
m_HasPathChanged = false;
// Check extension and if it is missing, add .png
size_t pos = filename.rfind(L'\\');
@ -626,6 +628,7 @@ void TintedImage::ReadOptions(ConfigParser& parser, const WCHAR* section, const
ColorMatrix oldColorMatrix = *m_ColorMatrix;
RotateFlipType oldFlip = m_Flip;
REAL oldRotate = m_Rotate;
std::wstring oldPath = m_Path;
m_Path = parser.ReadString(section, m_OptionArray[OptionIndexImagePath], imagePath);
if (!m_Path.empty())
@ -636,6 +639,8 @@ void TintedImage::ReadOptions(ConfigParser& parser, const WCHAR* section, const
}
}
m_HasPathChanged = (oldPath != m_Path);
if (!m_DisableTransform)
{
m_Crop.X = m_Crop.Y = m_Crop.Width = m_Crop.Height = -1;