mirror of
https://github.com/penpot/penpot.git
synced 2026-02-17 01:54:43 -05:00
Compare commits
1 Commits
alotor-fix
...
staging-re
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2d09a6140 |
@@ -642,13 +642,15 @@ export class SelectionController extends EventTarget {
|
||||
} else {
|
||||
this.#anchorNode = anchorNode;
|
||||
this.#anchorOffset = anchorOffset;
|
||||
if (anchorNode === focusNode) {
|
||||
this.#focusNode = this.#anchorNode;
|
||||
this.#focusOffset = this.#anchorOffset;
|
||||
this.#focusNode = focusNode;
|
||||
this.#focusOffset = focusOffset;
|
||||
// setPosition() collapses the selection to a single caret. We must only use it
|
||||
// when anchorOffset === focusOffset. When both points are in the same node but
|
||||
// offsets differ (e.g. selecting "hola" in "hola adios"), we need setBaseAndExtent()
|
||||
// to preserve the range so we don't incorrectly collapse ranges and lose the selection.
|
||||
if (anchorNode === focusNode && anchorOffset === focusOffset) {
|
||||
this.#selection.setPosition(anchorNode, anchorOffset);
|
||||
} else {
|
||||
this.#focusNode = focusNode;
|
||||
this.#focusOffset = focusOffset;
|
||||
this.#selection.setBaseAndExtent(
|
||||
anchorNode,
|
||||
anchorOffset,
|
||||
|
||||
@@ -441,18 +441,12 @@ pub fn propagate_modifiers(
|
||||
db.cmp(&da)
|
||||
});
|
||||
|
||||
// This temporary bounds is necesary so the layouts can be calculated
|
||||
// correctly but will be discarded before the next iteration for the
|
||||
// bounds to be calculated properly with the modifiers.
|
||||
let mut bounds_temp = bounds.clone();
|
||||
|
||||
for id in &layout_reflows_vec {
|
||||
if reflown.contains(id) {
|
||||
continue;
|
||||
}
|
||||
reflow_shape(id, state, &mut reflown, &mut entries, &mut bounds_temp);
|
||||
reflow_shape(id, state, &mut reflown, &mut entries, &mut bounds);
|
||||
}
|
||||
layout_reflows = HashSet::new();
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
|
||||
Reference in New Issue
Block a user