Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Use a small fractional value instead
Browse files Browse the repository at this point in the history
  • Loading branch information
turt2live committed Feb 27, 2021
1 parent 0dd4d45 commit e43853d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/views/rooms/ReadReceiptMarker.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,14 @@ export default class ReadReceiptMarker extends React.PureComponent {
// then shift to the rightmost column,
// and then it will drop down to its resting position
//
// XXX: We use a `left: 1px` to trick velocity-animate into actually animating. This
// is a very annoying bug where if it thinks there's no change to `left` then it'll
// XXX: We use a fractional left value to trick velocity-animate into actually animating.
// This is a very annoying bug where if it thinks there's no change to `left` then it'll
// skip applying it, thus making our read receipt at +14px instead of +0px like it
// should be. This does cause 1px of drift for read receipts, however nobody should
// notice this while it's also falling.
startStyles.push({ top: startTopOffset+'px', left: '1px' });
// should be. This does cause a tiny amount of drift for read receipts, however with a
// value so small it's not perceived by a user.
// Note: Any smaller values (or trying to interchange units) might cause read receipts to
// fail to fall down or cause gaps.
startStyles.push({ top: startTopOffset+'px', left: '0.001px' });
enterTransitionOpts.push({
duration: bounce ? Math.min(Math.log(Math.abs(startTopOffset)) * 200, 3000) : 300,
easing: bounce ? 'easeOutBounce' : 'easeOutCubic',
Expand Down

0 comments on commit e43853d

Please sign in to comment.