corrections to allow palettes to be drawn correctly

This commit is contained in:
Dan Timson 2019-09-16 18:09:17 +01:00
parent 3a1b536c58
commit 24af63688b
2 changed files with 9 additions and 8 deletions

View File

@ -1062,12 +1062,12 @@ JKQTPColumnMathImage::JKQTPColumnMathImage(double x, double y, double width, dou
void JKQTPColumnMathImage::setImageColumn(size_t __value)
{
setImageColumn(static_cast<int>(__value));
setImageColumn(static_cast<int>(__value));
}
void JKQTPColumnMathImage::setModifierColumn(size_t __value)
{
setImageColumn(static_cast<int>(__value));
setModifierColumn(static_cast<int>(__value));
}
void JKQTPColumnMathImage::setImageColumn(int __value)
{

View File

@ -615,25 +615,26 @@ void JKQTPColorPaletteWithModifierStyleAndToolsMixin::cbDrawOutside(JKQTPEnhance
double internalModifierMin=0;
double internalModifierMax=0;
cbGetDataMinMax(internalDataMin, internalDataMax);
cbGetModifierDataMinMax(internalDataMin, internalDataMax);
cbGetModifierDataMinMax(internalModifierMin, internalModifierMax);
uint8_t h=1;
static const uint8_t dSize = 200*h;
if (modifierMode!=JKQTPMathImageModifierMode::ModifyNone) {
h=50;
}
const uint8_t steps=200;
const int dSize = steps*h;
std::vector<double> d(dSize, 0.0);
std::vector<double> dd(dSize, 0.0);
for (uint8_t i=0; i<dSize; i++) {
for (uint8_t i=0; i<steps; i++) {
for (uint8_t j=0; j<h; j++) {
d[i*h+j]=i;
dd[i*h+j]=j;
}
}
QImage b(h,200, QImage::Format_ARGB32);
JKQTPImageTools::array2image<double>(d.data(),h,dSize/h, b, palette, 0, dSize/h-1);
QImage b(h, steps, QImage::Format_ARGB32);
JKQTPImageTools::array2image<double>(d.data(),h, steps, b, palette, 0, steps-1);
if (modifierMode!=JKQTPMathImageModifierMode::ModifyNone) {
modifyImage(b, dd.data(), JKQTPMathImageDataType::DoubleArray, h,dSize/h, 0, h-1);
modifyImage(b, dd.data(), JKQTPMathImageDataType::DoubleArray, h, steps, 0, h-1);
}
if (colorBarRightVisible) {