ui: fix quote repost hitbox
The response from the wide rendered note was incorrect, leading to and incorrectly sized hitbox. This fixes that. Additionally, we include note options and note parent into the hitbox key, as this may influence the size of the note. Before: https://cdn.jb55.com/s/b2464c22a65adb12.png After: https://cdn.jb55.com/s/52545564d98d278e.png Fixes: https://github.com/damus-io/notedeck/issues/519 Closes: https://github.com/damus-io/notedeck/pull/537 Changelog-Fixed: Fix broken quote repost hitbox Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
@@ -73,7 +73,7 @@ pub fn render_note_preview(
|
||||
img_cache: &mut ImageCache,
|
||||
txn: &Transaction,
|
||||
id: &[u8; 32],
|
||||
_id_str: &str,
|
||||
parent: NoteKey,
|
||||
) -> NoteResponse {
|
||||
#[cfg(feature = "profiling")]
|
||||
puffin::profile_function!();
|
||||
@@ -117,6 +117,7 @@ pub fn render_note_preview(
|
||||
.wide(true)
|
||||
.note_previews(false)
|
||||
.options_button(true)
|
||||
.parent(parent)
|
||||
.show(ui)
|
||||
})
|
||||
.inner
|
||||
@@ -213,8 +214,8 @@ fn render_note_contents(
|
||||
}
|
||||
});
|
||||
|
||||
let note_action = if let Some((id, block_str)) = inline_note {
|
||||
render_note_preview(ui, ndb, note_cache, img_cache, txn, id, block_str).action
|
||||
let note_action = if let Some((id, _block_str)) = inline_note {
|
||||
render_note_preview(ui, ndb, note_cache, img_cache, txn, id, note_key).action
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user