drauu icon indicating copy to clipboard operation
drauu copied to clipboard

feat: add text support

Open ProsperBao opened this issue 2 years ago • 5 comments

I think as an SVG-based drawing tool in the browser, it should support adding text.

ProsperBao avatar Jul 28 '23 06:07 ProsperBao

Thanks! However, I think it's a pretty complex tool to implement right and provide good UX. I feel the current implementation still has a lot to improve, while honestly, it feels a bit out-of-scope. I guess it might be better to implement that in the userland? I don't really want to absorb and maintain this complexity.

antfu avatar Jul 31 '23 10:07 antfu

Thanks! However, I think it's a pretty complex tool to implement right and provide good UX. I feel the current implementation still has a lot to improve, while honestly, it feels a bit out-of-scope. I guess it might be better to implement that in the userland? I don't really want to absorb and maintain this complexity.

Actually, my initial goal was to support the addition of text functionality in an annotation project. I couldn't find any configuration options, so I thought about adding a feature myself. Alternatively, we could add the ability to import a custom module configuration from external sources. This would allow users to add a module according to their own preferences.

ProsperBao avatar Aug 01 '23 02:08 ProsperBao

we could add the ability to import a custom module configuration from external sources. This would allow users to add a module according to their own preferences.

Yeah I think that's the best approach. Feel free to go to that direction (and we could move the text model you have there to the playground as an example)

antfu avatar Aug 01 '23 12:08 antfu

Yeah

let me try.

ProsperBao avatar Aug 03 '23 01:08 ProsperBao

I think there is still a slight issue. I am unsure how to modify the type of DrawingMode without overriding the original type. My idea is to concatenate the keys based on options.models. However, it seems like this approach would require a lot of type inference.

ProsperBao avatar Aug 04 '23 02:08 ProsperBao