Per-view transient source-change highlights.
More...
#include "donner/editor/FlashDecorations.h"
|
|
using | Clock = std::chrono::steady_clock |
|
using | TimePoint = Clock::time_point |
|
| void | flash (SourceByteRange byteRange, TimePoint now, std::size_t bufferSize) |
| | Add a flash for byteRange.
|
| void | applySourceEdit (std::size_t offset, std::size_t removedLength, std::size_t insertedLength, std::size_t newBufferSize) |
| | Shift or drop existing flashes after a source edit.
|
| void | tick (TimePoint now) |
| | Remove expired flashes.
|
| std::vector< ActiveFlash > | activeBackgrounds (TimePoint now) const |
| | Return visible flashes for the current frame.
|
| std::optional< float > | nextWakeSeconds (TimePoint now) const |
| | Return seconds until the next fade frame should be drawn.
|
|
|
static constexpr std::size_t | kMaxFlashes = 64 |
| | Maximum number of simultaneous flashes retained by the view.
|
|
static constexpr float | kDurationSeconds = 0.4f |
| | Default fade duration for a source flash.
|
Per-view transient source-change highlights.
◆ activeBackgrounds()
| std::vector< ActiveFlash > donner::editor::FlashDecorations::activeBackgrounds |
( |
TimePoint | now | ) |
const |
|
nodiscard |
Return visible flashes for the current frame.
- Parameters
-
◆ applySourceEdit()
| void donner::editor::FlashDecorations::applySourceEdit |
( |
std::size_t | offset, |
|
|
std::size_t | removedLength, |
|
|
std::size_t | insertedLength, |
|
|
std::size_t | newBufferSize ) |
Shift or drop existing flashes after a source edit.
- Parameters
-
| offset | Edit start offset in the old buffer. |
| removedLength | Removed byte count in the old buffer. |
| insertedLength | Inserted byte count in the new buffer. |
| newBufferSize | Source buffer size after the edit. |
◆ flash()
| void donner::editor::FlashDecorations::flash |
( |
SourceByteRange | byteRange, |
|
|
TimePoint | now, |
|
|
std::size_t | bufferSize ) |
Add a flash for byteRange.
- Parameters
-
| byteRange | Source range to highlight. |
| now | Start time for the flash. |
| bufferSize | Current source buffer size for clamping. |
◆ nextWakeSeconds()
| std::optional< float > donner::editor::FlashDecorations::nextWakeSeconds |
( |
TimePoint | now | ) |
const |
|
nodiscard |
Return seconds until the next fade frame should be drawn.
- Parameters
-
◆ tick()
| void donner::editor::FlashDecorations::tick |
( |
TimePoint | now | ) |
|
Remove expired flashes.
- Parameters
-
The documentation for this class was generated from the following file: