fix maddin200 pointed problems

This commit is contained in:
shun-iwasawa 2022-03-15 14:58:34 +09:00 committed by manongjohn
parent c365f34223
commit fb88fabf54
3 changed files with 15 additions and 17 deletions

View file

@ -176,7 +176,7 @@ bool TPSDReader::doImageResources() {
hresd = FIXDPI(hres = read4Bytes(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.hres = hresd;
fseek(m_file, savepos, SEEK_SET);
@ -248,7 +248,7 @@ bool TPSDReader::readLayerInfo(int i) {
fseek(m_file, 6 * li->channels + 12, SEEK_CUR);
skipBlock(m_file); // skip "layer info: extra data";
} else {
li->chan = (TPSDChannelInfo *)mymalloc(li->channels *
li->chan = (TPSDChannelInfo *)mymalloc(li->channels *
sizeof(struct TPSDChannelInfo));
li->chindex = (int *)mymalloc((li->channels + 2) * sizeof(int));
li->chindex += 2; //
@ -558,7 +558,7 @@ void TPSDReader::readImageData(TRasterP &rasP, TPSDLayerInfo *li,
x1 = x0 + m_region.getLx() - 1;
// controllo che x1 rimanga all'interno dell'immagine
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
if (y0 >= m_headerInfo.rows) {
free(rledata);
@ -640,7 +640,7 @@ void TPSDReader::readImageData(TRasterP &rasP, TPSDLayerInfo *li,
m_layersSavebox[li->layerId] = layerSaveBox2;
else
m_layersSavebox[0] = layerSaveBox2;
TRasterP smallRas = rasP->extract(layerSaveBox2);
TRasterP smallRas = rasP->extract(layerSaveBox2);
assert(smallRas);
if (!smallRas) return;
// 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) {
if (!li) chan[ch].id = ch;
chan[ch].rowbytes = rb;
chan[ch].comptype = comp;
chan[ch].rows = chan->rows;
chan[ch].cols = chan->cols;
chan[ch].filepos = pos;
chan[ch].rowbytes = rb;
chan[ch].comptype = comp;
chan[ch].rows = chan->rows;
chan[ch].cols = chan->cols;
chan[ch].filepos = pos;
if (!chan->rows) continue;
@ -1030,7 +1030,7 @@ void readChannel(FILE *f, TPSDLayerInfo *li,
if (count > 2 * chan[ch].rowbytes) // this would be impossible
count = last; // make a guess, to help recover
last = count;
last = count;
chan[ch].rowpos[j] = pos;
pos += count;
@ -1294,9 +1294,8 @@ int TPSDParser::getLevelIdByName(std::string levelName) {
levelNameCount++;
}
}
if (lyid == 0 && lyid < 0) lyid = 0;
if (lyid < 0 && lyid != 0)
throw TImageException(m_path, "Layer ID not exists");
if (lyid < 0) throw TImageException(m_path, "Layer ID not exists");
return lyid;
}
int TPSDParser::getFramesCount(int levelId) {

View file

@ -137,7 +137,7 @@ int getPixelLength(double measuredLength, TMeasure *measure, double dpi,
double inchValue = measure->getCurrentUnit()->convertFrom(measuredLength);
return tround(inchValue * dpi);
}
}
} // namespace
//=============================================================================
// PeggingWidget
//-----------------------------------------------------------------------------
@ -266,7 +266,7 @@ void PeggingWidget::on00() {
m_01->setIcon(m_topPix.transformed(QMatrix().rotate(m_cutLx ? -90 : 90),
Qt::SmoothTransformation));
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));
m_10->setIcon(m_topPix.transformed(QMatrix().rotate(m_cutLy ? 0 : 180),
Qt::SmoothTransformation));
@ -601,7 +601,7 @@ void CanvasSizePopup::showEvent(QShowEvent *e) {
TPointD dpi = m_sl->getDpi();
double dimLx = getMeasuredLength(dim.lx, m_xMeasure, dpi.x,
"pixel");
double dimLy = getMeasuredLength(dim.ly, m_yMeasure, dpi.y,
double dimLy = getMeasuredLength(dim.ly, m_yMeasure, dpi.y,
"pixel");
m_currentXSize->setText(QString::number(dimLx));
m_currentYSize->setText(QString::number(dimLy));

View file

@ -2183,7 +2183,6 @@ void StageSchematicSplineNode::setSchematicNodePos(const QPointF &pos) const {
QPixmap StageSchematicSplineNode::getPixmap() {
return IconGenerator::instance()->getIcon(m_spline);
return QPixmap();
}
//--------------------------------------------------------