summaryrefslogtreecommitdiff
path: root/core/fxge/dib/cstretchengine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxge/dib/cstretchengine.cpp')
-rw-r--r--core/fxge/dib/cstretchengine.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/core/fxge/dib/cstretchengine.cpp b/core/fxge/dib/cstretchengine.cpp
index 9d3923adab..ad9a356f34 100644
--- a/core/fxge/dib/cstretchengine.cpp
+++ b/core/fxge/dib/cstretchengine.cpp
@@ -206,10 +206,11 @@ bool CStretchEngine::CWeightTable::Calc(int dest_len,
return true;
}
-PixelWeight* CStretchEngine::CWeightTable::GetPixelWeight(int pixel) const {
+const PixelWeight* CStretchEngine::CWeightTable::GetPixelWeight(
+ int pixel) const {
ASSERT(pixel >= m_DestMin);
- return reinterpret_cast<PixelWeight*>(const_cast<uint8_t*>(
- m_WeightTables.data() + (pixel - m_DestMin) * m_ItemSize));
+ return reinterpret_cast<const PixelWeight*>(
+ &m_WeightTables[(pixel - m_DestMin) * m_ItemSize]);
}
int* CStretchEngine::CWeightTable::GetValueFromPixelWeight(PixelWeight* pWeight,