mirror of
https://github.com/storytold/photocraft.git
synced 2026-11-21 09:26:43 +00:00
refactor(ui): name the Move layer offset shown_layer_offset
This commit is contained in:
1 parent
99e1138877
commit
bc947f667a
2 files changed
+2
-2
No files matched your search
@@ -4487,7 +4487,7 @@ pub(crate) fn layer_edges_rect(app: &PhotocraftApp, idx: usize) -> Option<photoc
|
||||
if b.is_empty() {
|
||||
return None;
|
||||
}
|
||||
let (dx, dy) = crate::move_ui::shown_offset(app, st.doc.id, st.revision, id).unwrap_or((0, 0));
|
||||
let (dx, dy) = crate::move_ui::shown_layer_offset(app, st.doc.id, st.revision, id).unwrap_or((0, 0));
|
||||
Some(b.translate(dx, dy))
|
||||
}
|
||||
|
||||
|
||||
@@ -174,7 +174,7 @@ fn with_descendants(doc: &Document, ids: &[LayerId]) -> Vec<LayerId> {
|
||||
/// offset of the latest Move drag frame drawn ([`display_doc`]) when the layer moves with the drag,
|
||||
/// so its Layer Edges outline moves in lockstep with its pixels (#2413). `None` when it shows
|
||||
/// where it is.
|
||||
pub(crate) fn shown_offset(app: &PhotocraftApp, doc: DocId, revision: u64, id: LayerId) -> Option<(i32, i32)> {
|
||||
pub(crate) fn shown_layer_offset(app: &PhotocraftApp, doc: DocId, revision: u64, id: LayerId) -> Option<(i32, i32)> {
|
||||
let p = app.move_preview.as_ref().filter(|p| p.doc == doc && p.revision == revision && !p.floating && p.shown.is_some())?;
|
||||
if !p.moving.contains(&id) {
|
||||
return None;
|
||||
|
||||
Reference in new issue
Block a user