Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/ui/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ void Manager::flipDisplay()
if (!m_display)
return;

// Frame-rate limiter: only flip at most 120 times per second
// Frame-rate limiter: we want to limit the number of flips to avoid
// consuming 100% CPU on too frequent document canvas redraws
double currentTime = base::current_tick() / 1000.0; // Convert milliseconds to seconds
double timeSinceLastFlip = currentTime - m_lastFlipTime;

Expand Down
2 changes: 1 addition & 1 deletion src/ui/manager.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ namespace ui {
// Frame-limited redraw mechanism
bool m_redrawRequested;
double m_lastFlipTime;
static constexpr double MIN_FRAME_INTERVAL = 1.0 / 120.0; // 120 FPS max
static constexpr double MIN_FRAME_INTERVAL = 1.0 / 720.0; // 720 FPS max
};

} // namespace ui
Loading