mirror of
https://github.com/emilk/egui.git
synced 2026-08-31 05:40:03 -04:00
Enforce writing username in TODO comments (#4235)
This commit is contained in:
@@ -2770,7 +2770,7 @@ impl Context {
|
||||
/// The `Context` lock is held while the given closure is called!
|
||||
///
|
||||
/// Returns `None` if acesskit is off.
|
||||
// TODO: consider making both RO and RW versions
|
||||
// TODO(emilk): consider making both RO and RW versions
|
||||
#[cfg(feature = "accesskit")]
|
||||
pub fn accesskit_node_builder<R>(
|
||||
&self,
|
||||
|
||||
@@ -236,7 +236,7 @@ impl InputState {
|
||||
// So we smooth it out over several frames for a nicer user experience when scrolling in egui.
|
||||
unprocessed_scroll_delta += raw_scroll_delta;
|
||||
let dt = stable_dt.at_most(0.1);
|
||||
let t = crate::emath::exponential_smooth_factor(0.90, 0.1, dt); // reach _% in _ seconds. TODO: parameterize
|
||||
let t = crate::emath::exponential_smooth_factor(0.90, 0.1, dt); // reach _% in _ seconds. TODO(emilk): parameterize
|
||||
|
||||
for d in 0..2 {
|
||||
if unprocessed_scroll_delta[d].abs() < 1.0 {
|
||||
|
||||
@@ -247,8 +247,8 @@ pub(crate) fn interact(
|
||||
hits.click.iter().chain(&hits.drag).map(|w| w.id).collect()
|
||||
} else {
|
||||
// Whatever is topmost is what we are hovering.
|
||||
// TODO: consider handle hovering over multiple top-most widgets?
|
||||
// TODO: allow hovering close widgets?
|
||||
// TODO(emilk): consider handle hovering over multiple top-most widgets?
|
||||
// TODO(emilk): allow hovering close widgets?
|
||||
hits.contains_pointer
|
||||
.last()
|
||||
.map(|w| w.id)
|
||||
|
||||
@@ -243,7 +243,7 @@ impl Options {
|
||||
pub fn ui(&mut self, ui: &mut crate::Ui) {
|
||||
let Self {
|
||||
style, // covered above
|
||||
zoom_factor: _, // TODO
|
||||
zoom_factor: _, // TODO(emilk)
|
||||
zoom_with_keyboard,
|
||||
tessellation_options,
|
||||
repaint_on_widget_change,
|
||||
|
||||
@@ -8,7 +8,7 @@ use super::{
|
||||
};
|
||||
|
||||
/// Turn on to help debug this
|
||||
const DEBUG: bool = false; // TODO: don't merge this while `true`
|
||||
const DEBUG: bool = false; // Don't merge `true`!
|
||||
|
||||
fn paint_selection(
|
||||
ui: &Ui,
|
||||
@@ -169,7 +169,7 @@ impl LabelSelectionState {
|
||||
|
||||
if ctx.input(|i| i.pointer.any_pressed() && !i.modifiers.shift) {
|
||||
// Maybe a new selection is about to begin, but the old one is over:
|
||||
// state.selection = None; // TODO: this makes sense, but doesn't work as expected.
|
||||
// state.selection = None; // TODO(emilk): this makes sense, but doesn't work as expected.
|
||||
}
|
||||
|
||||
state.selection_bbox_last_frame = state.selection_bbox_this_frame;
|
||||
@@ -562,7 +562,7 @@ impl LabelSelectionState {
|
||||
old.widget_id != new_primary.widget_id || old.ccursor != new_primary.ccursor
|
||||
});
|
||||
if primary_changed && new_primary.widget_id == widget_id {
|
||||
let is_fully_visible = ui.clip_rect().contains_rect(response.rect); // TODO: remove this HACK workaround for https://github.com/emilk/egui/issues/1531
|
||||
let is_fully_visible = ui.clip_rect().contains_rect(response.rect); // TODO(emilk): remove this HACK workaround for https://github.com/emilk/egui/issues/1531
|
||||
if selection_changed && !is_fully_visible {
|
||||
// Scroll to keep primary cursor in view:
|
||||
let row_height = estimate_row_height(galley);
|
||||
|
||||
@@ -452,7 +452,7 @@ impl ImageSize {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: unit-tests
|
||||
// TODO(jprochazk): unit-tests
|
||||
fn scale_to_fit(image_size: Vec2, available_size: Vec2, maintain_aspect_ratio: bool) -> Vec2 {
|
||||
if maintain_aspect_ratio {
|
||||
let ratio_x = available_size.x / image_size.x;
|
||||
|
||||
@@ -687,7 +687,7 @@ impl<'t> TextEdit<'t> {
|
||||
let primary_cursor_rect =
|
||||
cursor_rect(galley_pos, &galley, &cursor_range.primary, row_height);
|
||||
|
||||
let is_fully_visible = ui.clip_rect().contains_rect(rect); // TODO: remove this HACK workaround for https://github.com/emilk/egui/issues/1531
|
||||
let is_fully_visible = ui.clip_rect().contains_rect(rect); // TODO(emilk): remove this HACK workaround for https://github.com/emilk/egui/issues/1531
|
||||
if (response.changed || selection_changed) && !is_fully_visible {
|
||||
// Scroll to keep primary cursor in view:
|
||||
ui.scroll_to_rect(primary_cursor_rect, None);
|
||||
|
||||
Reference in New Issue
Block a user