zhouhua / obsidian-export-image

Easily convert your article to image.
MIT License
49 stars 2 forks source link

Image with vertical scroll is cut off #21

Closed RonSijm closed 2 months ago

RonSijm commented 2 months ago

Hey there,

I hope this is not a duplicate issue, but most of the other issues are in Chinese, so I don't really know what's going on there.

Anyways, the issue is, when creating a long vertical page, like a long diagram, the image is cut off, and the image is not scrolled to the left. For example something like this:


flowchart LR
    A[Christmas] -->|Get money| B(Go shopping)
    B --> C{Let me think}
    C -->|One| D[Laptop]
    C -->|Two| E[iPhone]
    C -->|Three| F[fa:fa-car Car]
    F -->|Three| G[Other stuff]
    G --> H[Long Diagram1]
      --> I[Long Diagram2]
      --> J[Long Diagram3]
      --> K[Long Diagram4]
      --> L[Long Diagram5]
      --> M[Long Diagram6]
      --> N[Long Diagram7]
      --> O[Long Diagram8]
      --> P[Long Diagram9]
      --> Q[Long Diagram10]
      --> R[Long Diagram11]
      --> S[Long Diagram12]
      --> T[Long Diagram13]
      --> U[Long Diagram14]
      --> V[Long Diagram15]
      --> W[Long Diagram16]

mermaid

flowchart LR A[Christmas] -->|Get money| B(Go shopping) B --> C{Let me think} C -->|One| D[Laptop] C -->|Two| E[iPhone] C -->|Three| F[fa:fa-car Car] F -->|Three| G[Other stuff] G --> H[Long Diagram1] --> I[Long Diagram2] --> J[Long Diagram3] --> K[Long Diagram4] --> L[Long Diagram5] --> M[Long Diagram6] --> N[Long Diagram7] --> O[Long Diagram8] --> P[Long Diagram9] --> Q[Long Diagram10] --> R[Long Diagram11] --> S[Long Diagram12] --> T[Long Diagram13] --> U[Long Diagram14] --> V[Long Diagram15] --> W[Long Diagram16]

This image will end up being cut off at the first part of the screen

zhouhua commented 2 months ago

Yeah, I didn't consider this situation, just using the width of the reading area as the width of the screenshot image.

Perhaps this plugin should add an image width configuration?

zhouhua commented 2 months ago

I just refactored the plugin and now it supports setting the width of images. The screenshot function works in both edit and view modes, and the performance has also been greatly improved.

RonSijm commented 2 months ago

Cool, thanks for implementing this is quickly 👍