fix maddin200 pointed problems
This commit is contained in:
parent
c365f34223
commit
fb88fabf54
3 changed files with 15 additions and 17 deletions
|
@ -176,7 +176,7 @@ bool TPSDReader::doImageResources() {
|
||||||
hresd = FIXDPI(hres = read4Bytes(m_file));
|
hresd = FIXDPI(hres = read4Bytes(m_file));
|
||||||
read2Bytes(m_file);
|
read2Bytes(m_file);
|
||||||
read2Bytes(m_file);
|
read2Bytes(m_file);
|
||||||
vresd = FIXDPI(vres = read4Bytes(m_file));
|
vresd = FIXDPI(vres = read4Bytes(m_file));
|
||||||
m_headerInfo.vres = vresd;
|
m_headerInfo.vres = vresd;
|
||||||
m_headerInfo.hres = hresd;
|
m_headerInfo.hres = hresd;
|
||||||
fseek(m_file, savepos, SEEK_SET);
|
fseek(m_file, savepos, SEEK_SET);
|
||||||
|
@ -248,7 +248,7 @@ bool TPSDReader::readLayerInfo(int i) {
|
||||||
fseek(m_file, 6 * li->channels + 12, SEEK_CUR);
|
fseek(m_file, 6 * li->channels + 12, SEEK_CUR);
|
||||||
skipBlock(m_file); // skip "layer info: extra data";
|
skipBlock(m_file); // skip "layer info: extra data";
|
||||||
} else {
|
} else {
|
||||||
li->chan = (TPSDChannelInfo *)mymalloc(li->channels *
|
li->chan = (TPSDChannelInfo *)mymalloc(li->channels *
|
||||||
sizeof(struct TPSDChannelInfo));
|
sizeof(struct TPSDChannelInfo));
|
||||||
li->chindex = (int *)mymalloc((li->channels + 2) * sizeof(int));
|
li->chindex = (int *)mymalloc((li->channels + 2) * sizeof(int));
|
||||||
li->chindex += 2; //
|
li->chindex += 2; //
|
||||||
|
@ -558,7 +558,7 @@ void TPSDReader::readImageData(TRasterP &rasP, TPSDLayerInfo *li,
|
||||||
x1 = x0 + m_region.getLx() - 1;
|
x1 = x0 + m_region.getLx() - 1;
|
||||||
// controllo che x1 rimanga all'interno dell'immagine
|
// controllo che x1 rimanga all'interno dell'immagine
|
||||||
if (x1 >= m_headerInfo.cols) x1 = m_headerInfo.cols - 1;
|
if (x1 >= m_headerInfo.cols) x1 = m_headerInfo.cols - 1;
|
||||||
y0 = m_region.getP00().y;
|
y0 = m_region.getP00().y;
|
||||||
// se y0 è fuori dalle dimensioni dell'immagine ritorna un'immagine vuota
|
// se y0 è fuori dalle dimensioni dell'immagine ritorna un'immagine vuota
|
||||||
if (y0 >= m_headerInfo.rows) {
|
if (y0 >= m_headerInfo.rows) {
|
||||||
free(rledata);
|
free(rledata);
|
||||||
|
@ -640,7 +640,7 @@ void TPSDReader::readImageData(TRasterP &rasP, TPSDLayerInfo *li,
|
||||||
m_layersSavebox[li->layerId] = layerSaveBox2;
|
m_layersSavebox[li->layerId] = layerSaveBox2;
|
||||||
else
|
else
|
||||||
m_layersSavebox[0] = layerSaveBox2;
|
m_layersSavebox[0] = layerSaveBox2;
|
||||||
TRasterP smallRas = rasP->extract(layerSaveBox2);
|
TRasterP smallRas = rasP->extract(layerSaveBox2);
|
||||||
assert(smallRas);
|
assert(smallRas);
|
||||||
if (!smallRas) return;
|
if (!smallRas) return;
|
||||||
// Trovo l'indice di colonna del primo pixel del livello che deve essere letto
|
// Trovo l'indice di colonna del primo pixel del livello che deve essere letto
|
||||||
|
@ -1005,11 +1005,11 @@ void readChannel(FILE *f, TPSDLayerInfo *li,
|
||||||
|
|
||||||
for (ch = 0; ch < channels; ++ch) {
|
for (ch = 0; ch < channels; ++ch) {
|
||||||
if (!li) chan[ch].id = ch;
|
if (!li) chan[ch].id = ch;
|
||||||
chan[ch].rowbytes = rb;
|
chan[ch].rowbytes = rb;
|
||||||
chan[ch].comptype = comp;
|
chan[ch].comptype = comp;
|
||||||
chan[ch].rows = chan->rows;
|
chan[ch].rows = chan->rows;
|
||||||
chan[ch].cols = chan->cols;
|
chan[ch].cols = chan->cols;
|
||||||
chan[ch].filepos = pos;
|
chan[ch].filepos = pos;
|
||||||
|
|
||||||
if (!chan->rows) continue;
|
if (!chan->rows) continue;
|
||||||
|
|
||||||
|
@ -1030,7 +1030,7 @@ void readChannel(FILE *f, TPSDLayerInfo *li,
|
||||||
|
|
||||||
if (count > 2 * chan[ch].rowbytes) // this would be impossible
|
if (count > 2 * chan[ch].rowbytes) // this would be impossible
|
||||||
count = last; // make a guess, to help recover
|
count = last; // make a guess, to help recover
|
||||||
last = count;
|
last = count;
|
||||||
|
|
||||||
chan[ch].rowpos[j] = pos;
|
chan[ch].rowpos[j] = pos;
|
||||||
pos += count;
|
pos += count;
|
||||||
|
@ -1294,9 +1294,8 @@ int TPSDParser::getLevelIdByName(std::string levelName) {
|
||||||
levelNameCount++;
|
levelNameCount++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (lyid == 0 && lyid < 0) lyid = 0;
|
|
||||||
if (lyid < 0 && lyid != 0)
|
if (lyid < 0) throw TImageException(m_path, "Layer ID not exists");
|
||||||
throw TImageException(m_path, "Layer ID not exists");
|
|
||||||
return lyid;
|
return lyid;
|
||||||
}
|
}
|
||||||
int TPSDParser::getFramesCount(int levelId) {
|
int TPSDParser::getFramesCount(int levelId) {
|
||||||
|
|
|
@ -137,7 +137,7 @@ int getPixelLength(double measuredLength, TMeasure *measure, double dpi,
|
||||||
double inchValue = measure->getCurrentUnit()->convertFrom(measuredLength);
|
double inchValue = measure->getCurrentUnit()->convertFrom(measuredLength);
|
||||||
return tround(inchValue * dpi);
|
return tround(inchValue * dpi);
|
||||||
}
|
}
|
||||||
}
|
} // namespace
|
||||||
//=============================================================================
|
//=============================================================================
|
||||||
// PeggingWidget
|
// PeggingWidget
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -266,7 +266,7 @@ void PeggingWidget::on00() {
|
||||||
m_01->setIcon(m_topPix.transformed(QMatrix().rotate(m_cutLx ? -90 : 90),
|
m_01->setIcon(m_topPix.transformed(QMatrix().rotate(m_cutLx ? -90 : 90),
|
||||||
Qt::SmoothTransformation));
|
Qt::SmoothTransformation));
|
||||||
m_11->setIcon(
|
m_11->setIcon(
|
||||||
m_topRightPix.transformed(QMatrix().rotate(m_cutLx || m_cutLx ? -90 : 90),
|
m_topRightPix.transformed(QMatrix().rotate(m_cutLx || m_cutLy ? -90 : 90),
|
||||||
Qt::SmoothTransformation));
|
Qt::SmoothTransformation));
|
||||||
m_10->setIcon(m_topPix.transformed(QMatrix().rotate(m_cutLy ? 0 : 180),
|
m_10->setIcon(m_topPix.transformed(QMatrix().rotate(m_cutLy ? 0 : 180),
|
||||||
Qt::SmoothTransformation));
|
Qt::SmoothTransformation));
|
||||||
|
@ -601,7 +601,7 @@ void CanvasSizePopup::showEvent(QShowEvent *e) {
|
||||||
TPointD dpi = m_sl->getDpi();
|
TPointD dpi = m_sl->getDpi();
|
||||||
double dimLx = getMeasuredLength(dim.lx, m_xMeasure, dpi.x,
|
double dimLx = getMeasuredLength(dim.lx, m_xMeasure, dpi.x,
|
||||||
"pixel");
|
"pixel");
|
||||||
double dimLy = getMeasuredLength(dim.ly, m_yMeasure, dpi.y,
|
double dimLy = getMeasuredLength(dim.ly, m_yMeasure, dpi.y,
|
||||||
"pixel");
|
"pixel");
|
||||||
m_currentXSize->setText(QString::number(dimLx));
|
m_currentXSize->setText(QString::number(dimLx));
|
||||||
m_currentYSize->setText(QString::number(dimLy));
|
m_currentYSize->setText(QString::number(dimLy));
|
||||||
|
|
|
@ -2183,7 +2183,6 @@ void StageSchematicSplineNode::setSchematicNodePos(const QPointF &pos) const {
|
||||||
|
|
||||||
QPixmap StageSchematicSplineNode::getPixmap() {
|
QPixmap StageSchematicSplineNode::getPixmap() {
|
||||||
return IconGenerator::instance()->getIcon(m_spline);
|
return IconGenerator::instance()->getIcon(m_spline);
|
||||||
return QPixmap();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------
|
//--------------------------------------------------------
|
||||||
|
|
Loading…
Reference in a new issue