-
Notifications
You must be signed in to change notification settings - Fork 117
Closed
Labels
CDX-ChemDrawBucket: Save/View/Open of CDX forrmat related issuesBucket: Save/View/Open of CDX forrmat related issuesPriority: High
Milestone
Description
Steps to Reproduce
- Click Open... button (Ctrl+O)
- Select open from file
- Select file: Shifted label.pptx
(Source CDX: FromPPTX.zip ) - Click Open
Actual behavior
Label is shifted to the left. It seems that source file save text label coordinates of the center of label but ketcher uses them as top left corner of the label
Environment details:
- Ketcher Version 2.18.0-rc.5 Build at 2024-02-09; 17:07:18
- Indigo Toolkit Version 1.18.0-rc.6+cdx.0-g99f004a82-x86_64-linux-gnu-11.4.0
- Chrome Version Version 121.0.6167.161 (Official Build) (64-bit)
- Win10
- Issue found while testing Add support for opening structures in CDX format embedded into MS PowerPoint ketcher#3914
Solution
Text justification support should be added to KET-format.
Currently text labels support represented in KET by the following json:
{
"type": "text",
"data": {
"content": "{\"blocks\":[{\"key\":\"6ho73\",\"text\":\"TEST\",\"type\":\"unstyled\",\"depth\":0,\"inlineStyleRanges\":[],\"entityRanges\":[],\"data\":{}}],\"entityMap\":{}}",
"position": {
"x": 13.625,
"y": -10.125,
"z": 0
},
"pos": [
{
"x": 13.625,
"y": -10.125,
"z": 0
},
{
"x": 13.625,
"y": -10.5,
"z": 0
},
{
"x": 14.455859375,
"y": -10.5,
"z": 0
},
{
"x": 14.455859375,
"y": -10.125,
"z": 0
}
]
}
}
where position is a left top text coordinate and pos is a bounding box.
To fix the issue it's necessary to support additional "justification" attribute:
{
"type": "text",
"data": {
"content": "----",
"position": {
/----/
},
"pos": [
],
"justification" : "center" // can be "center", "left", "right" and "full"
}
}
Metadata
Metadata
Assignees
Labels
CDX-ChemDrawBucket: Save/View/Open of CDX forrmat related issuesBucket: Save/View/Open of CDX forrmat related issuesPriority: High
Type
Projects
Status
Done