mirror of
https://github.com/penpot/penpot.git
synced 2025-12-31 02:18:40 -05:00
Compare commits
2 Commits
develop
...
azazeln28-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ddaca3e32 | ||
|
|
0c3cc20522 |
@@ -141,6 +141,7 @@
|
||||
heap (mem/get-heap-u8)]
|
||||
(.set heap (js/Uint8Array. buffer) metadata-offset)))
|
||||
|
||||
(prn "set_shape_text_content")
|
||||
(h/call wasm/internal-module "_set_shape_text_content"))
|
||||
|
||||
(def ^:private emoji-pattern #"[\uD83C-\uDBFF][\uDC00-\uDFFF]|[\u2600-\u27BF]")
|
||||
|
||||
@@ -1057,7 +1057,7 @@ export class SelectionController extends EventTarget {
|
||||
fragment.children.length === 1 &&
|
||||
fragment.firstElementChild?.dataset?.inline === "force"
|
||||
) {
|
||||
const collapseNode = fragment.lastElementChild.firstChild;
|
||||
const collapseNode = fragment.lastElementChild.firstChild.firstChild;
|
||||
if (this.isInlineStart) {
|
||||
this.focusInline.before(...fragment.firstElementChild.children);
|
||||
} else if (this.isInlineEnd) {
|
||||
@@ -1399,16 +1399,18 @@ export class SelectionController extends EventTarget {
|
||||
|
||||
this.removeSelected();
|
||||
|
||||
const newParagraph = splitParagraph(
|
||||
currentParagraph,
|
||||
currentInline,
|
||||
this.focusOffset,
|
||||
);
|
||||
currentParagraph.after(newParagraph);
|
||||
|
||||
this.#mutations.update(currentParagraph);
|
||||
this.#mutations.add(newParagraph);
|
||||
|
||||
if (currentParagraph && currentInline) {
|
||||
const newParagraph = splitParagraph(
|
||||
currentParagraph,
|
||||
currentInline,
|
||||
this.focusOffset,
|
||||
);
|
||||
currentParagraph.after(newParagraph);
|
||||
this.#mutations.update(currentParagraph);
|
||||
this.#mutations.add(newParagraph);
|
||||
} else {
|
||||
console.log(this.#focusNode)
|
||||
}
|
||||
// FIXME: Missing collapse?
|
||||
}
|
||||
|
||||
|
||||
@@ -53,6 +53,7 @@ pub fn render(
|
||||
continue;
|
||||
}
|
||||
|
||||
// Performs the text layout.
|
||||
skia_paragraph.layout(shape.bounds().width());
|
||||
|
||||
let paragraph_height = skia_paragraph.height();
|
||||
|
||||
@@ -11,6 +11,7 @@ pub extern "C" fn clear_shape_text() {
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: We should modify text content in a smarter way.
|
||||
#[no_mangle]
|
||||
pub extern "C" fn set_shape_text_content() {
|
||||
let bytes = mem::bytes();
|
||||
|
||||
Reference in New Issue
Block a user