修复若干bug

This commit is contained in:
2026-08-02 12:15:48 +08:00
parent 64da97b7c7
commit 63b97c1bb2
22 changed files with 116 additions and 192 deletions
+6 -6
View File
@@ -23,11 +23,11 @@ std::shared_ptr<Timeline_Stream> Time_Axis::timeline_stream() {
void Time_Axis::set_timeline_stream(std::shared_ptr<Timeline_Stream> value) {
d()->set_state_value(&Time_Axis_Render_State::timeline_stream, std::move(value));
}
bool Time_Axis::start_coord_to_end_coord() {
return d()->edit_state_value(&Time_Axis_Render_State::start_coord_to_end_coord);
bool Time_Axis::newest_at_axis_start() {
return d()->edit_state_value(&Time_Axis_Render_State::newest_at_axis_start);
}
void Time_Axis::set_start_coord_to_end_coord(bool value) {
d()->set_state_value(&Time_Axis_Render_State::start_coord_to_end_coord, value);
void Time_Axis::set_newest_at_axis_start(bool value) {
d()->set_state_value(&Time_Axis_Render_State::newest_at_axis_start, value);
}
int Time_Axis::append_time(Time_Of_Day time) {
if (!ok())
@@ -42,7 +42,7 @@ int Time_Axis::append_time(Time_Of_Day time) {
Time_Of_Day Time_Axis::tick_to_time(int tick) {
auto stream = timeline_stream();
if (stream)
return stream->capture(visible_time_point_count(), d()->state_data(State_Edit)->label_tick_interval_hint(), start_coord_to_end_coord()).time_by_tick(tick);
return stream->capture(visible_time_point_count(), d()->state_data(State_Edit)->label_tick_interval_hint(), newest_at_axis_start()).time_by_tick(tick);
return d()->time_by_tick(tick);
}
Time_Axis::Builder::Builder(std::shared_ptr<Renderable> parent, Orientation orientation) {
@@ -60,7 +60,7 @@ std::shared_ptr<Time_Axis> Time_Axis::Builder::build() {
PROP_R(std::string, time_format)
PROP_R(Font, font)
PROP_R(std::shared_ptr<Timeline_Stream>, timeline_stream)
PROP_R(bool, start_coord_to_end_coord)
PROP_R(bool, newest_at_axis_start)
sc->visible_time_point_count = std::max(1, sc->visible_time_point_count);
sc->tick_label_spacing_px = std::max(1, sc->tick_label_spacing_px);
if (!sc->timeline_stream)