Fix rotate double

This commit is contained in:
Svetlana Kulikova
2024-12-11 14:46:18 +03:00
parent 3d7eced836
commit 4e6e3ce5f0
4 changed files with 8 additions and 8 deletions

View File

@ -1279,7 +1279,7 @@ CFile.prototype["getAnnotationsInfo"] = function(pageIndex)
else if (rec["Type"] == 12) else if (rec["Type"] == 12)
{ {
rec["Icon"] = reader.readString(); rec["Icon"] = reader.readString();
rec["Rotate"] = reader.readInt(); rec["Rotate"] = reader.readDouble2();
rec["InRect"] = []; rec["InRect"] = [];
for (let i = 0; i < 8; ++i) for (let i = 0; i < 8; ++i)
rec["InRect"].push(reader.readDouble2()); rec["InRect"].push(reader.readDouble2());

View File

@ -1280,7 +1280,7 @@ int main(int argc, char* argv[])
} }
// ANNOTS // ANNOTS
if (false) if (true)
{ {
BYTE* pAnnots = GetAnnotationsInfo(pGrFile, -1); BYTE* pAnnots = GetAnnotationsInfo(pGrFile, -1);
nLength = READ_INT(pAnnots); nLength = READ_INT(pAnnots);
@ -1870,7 +1870,7 @@ int main(int argc, char* argv[])
nPathLength = READ_INT(pAnnots + i); nPathLength = READ_INT(pAnnots + i);
i += 4; i += 4;
std::cout << "Rotate " << nPathLength << ", "; std::cout << "Rotate " << nPathLength / 10000.0 << ", ";
nPathLength = READ_INT(pAnnots + i); nPathLength = READ_INT(pAnnots + i);
i += 4; i += 4;

View File

@ -2371,9 +2371,9 @@ CAnnotStamp::CAnnotStamp(PDFDoc* pdfDoc, Object* oAnnotRef, int nPageIndex) : CA
} }
oObj.free(); oObj.free();
m_nRotate = 0; m_dRotate = 0;
if (oAnnot.dictLookup("Rotate", &oObj)->isInt()) if (oAnnot.dictLookup("Rotate", &oObj)->isNum())
m_nRotate = oObj.getInt(); m_dRotate = oObj.getNum();
oObj.free(); oObj.free();
double m[6] = { 1, 0, 0, 1, 0, 0 }, bbox[4] = { 0, 0, 0, 0 }; double m[6] = { 1, 0, 0, 1, 0, 0 }, bbox[4] = { 0, 0, 0, 0 };
@ -4193,7 +4193,7 @@ void CAnnotStamp::ToWASM(NSWasm::CData& oRes)
CAnnotMarkup::ToWASM(oRes); CAnnotMarkup::ToWASM(oRes);
oRes.WriteString(m_sName); oRes.WriteString(m_sName);
oRes.AddInt(m_nRotate); oRes.WriteDouble(m_dRotate);
oRes.WriteDouble(m_dX1); oRes.WriteDouble(m_dX1);
oRes.WriteDouble(m_dY1); oRes.WriteDouble(m_dY1);
oRes.WriteDouble(m_dX2); oRes.WriteDouble(m_dX2);

View File

@ -579,7 +579,7 @@ public:
void ToWASM(NSWasm::CData& oRes) override; void ToWASM(NSWasm::CData& oRes) override;
private: private:
std::string m_sName; // Иконка std::string m_sName; // Иконка
int m_nRotate; double m_dRotate;
double m_dX1, m_dY1, m_dX2, m_dY2, m_dX3, m_dY3, m_dX4, m_dY4; double m_dX1, m_dY1, m_dX2, m_dY2, m_dX3, m_dY3, m_dX4, m_dY4;
}; };