FIX: setWindow参数设置错误
parent
793402e3c5
commit
35e7648206
|
@ -51,7 +51,7 @@ void PreviewWindow::paintGL()
|
|||
glClearColor(backgroundColor.redF(), backgroundColor.greenF(), backgroundColor.blueF(), backgroundColor.alphaF());
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
painter->begin(this);
|
||||
painter->setWindow(0, 0, logicalSize.width(), logicalSize.height());
|
||||
painter->setWindow(0, 0, logicalSize.width() *devicePixelRatioF(), logicalSize.height() * devicePixelRatioF());
|
||||
painter->setRenderHint(QPainter::Antialiasing);
|
||||
painter->setRenderHint(QPainter::HighQualityAntialiasing);
|
||||
layerManager->paint(painter,this->size(),currentLayer);
|
||||
|
|
|
@ -84,7 +84,7 @@ FolderLayerWrapper* PaintingUtil::handleLayerWrapper(LayerWrapper* nowLayer, QTr
|
|||
//qDebug() << leafLayer<<"------" << painterPath;
|
||||
// transform to -1£¬ 1
|
||||
QTransform trans;
|
||||
double maxLen = std::max(bound.width(), bound.height());
|
||||
double maxLen = std::max(bound.width(), bound.height()) * 1.00001;
|
||||
qDebug() << maxLen << bound;
|
||||
trans.scale(1 / maxLen, 1 / maxLen);
|
||||
trans.translate(-bound.center().x(), -bound.center().y());
|
||||
|
|
74
test.json
74
test.json
|
@ -29,30 +29,6 @@
|
|||
"children": [
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"element": 0,
|
||||
"is-folder": false,
|
||||
"name": "Leaf1",
|
||||
"styles": [
|
||||
{
|
||||
"enableEachSideIndependent": false,
|
||||
"left": "AACgQAEAIZwAf///AZ5X/w==",
|
||||
"right": "AADgQAAACJw=",
|
||||
"type": "stroke"
|
||||
}
|
||||
],
|
||||
"transform": {
|
||||
"offset": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"rotation": 0,
|
||||
"scale": {
|
||||
"x": 1,
|
||||
"y": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"element": 0,
|
||||
"is-folder": false,
|
||||
|
@ -61,14 +37,14 @@
|
|||
{
|
||||
"enableEachSideIndependent": false,
|
||||
"left": "AABAQAEAIZwAf///AFqe/w==",
|
||||
"right": "AADgQAAACJw=",
|
||||
"right": "AABAQAEACJwAf////1UA/w==",
|
||||
"type": "stroke"
|
||||
}
|
||||
],
|
||||
"transform": {
|
||||
"offset": {
|
||||
"x": 150,
|
||||
"y": 0
|
||||
"x": 501,
|
||||
"y": -3
|
||||
},
|
||||
"rotation": 0,
|
||||
"scale": {
|
||||
|
@ -96,15 +72,51 @@
|
|||
{
|
||||
"element": 1,
|
||||
"is-folder": false,
|
||||
"name": "ReferencingGroupLayer",
|
||||
"name": "子图层-2",
|
||||
"styles": [
|
||||
],
|
||||
"transform": {
|
||||
"offset": {
|
||||
"x": 100,
|
||||
"y": 0
|
||||
"x": -2,
|
||||
"y": 515
|
||||
},
|
||||
"rotation": 45,
|
||||
"rotation": 0,
|
||||
"scale": {
|
||||
"x": 1,
|
||||
"y": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"element": 1,
|
||||
"is-folder": false,
|
||||
"name": "子图层-3",
|
||||
"styles": [
|
||||
],
|
||||
"transform": {
|
||||
"offset": {
|
||||
"x": -503,
|
||||
"y": -1
|
||||
},
|
||||
"rotation": 0,
|
||||
"scale": {
|
||||
"x": 1,
|
||||
"y": 1
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"element": 1,
|
||||
"is-folder": false,
|
||||
"name": "子图层-4",
|
||||
"styles": [
|
||||
],
|
||||
"transform": {
|
||||
"offset": {
|
||||
"x": -503,
|
||||
"y": 511
|
||||
},
|
||||
"rotation": 0,
|
||||
"scale": {
|
||||
"x": 1,
|
||||
"y": 1
|
||||
|
|
Loading…
Reference in New Issue