| 208 | }; |
| 209 | |
| 210 | TEST_F(SelectionOperatorModalTest, PolygonOperatorUndoesOnlyFromBoundActionAndUnboundKeysPassThrough) { |
| 211 | set_initial_selection({1, 0}); |
| 212 | service().setTestingScreenPositions(make_screen_positions({ |
| 213 | 80.0f, |
| 214 | 80.0f, |
| 215 | 10.0f, |
| 216 | 10.0f, |
| 217 | })); |
| 218 | |
| 219 | SelectionStrokeOperator op; |
| 220 | OperatorProperties props; |
| 221 | props.set("mode", 2); |
| 222 | props.set("op", 0); |
| 223 | props.set("x", 0.0); |
| 224 | props.set("y", 0.0); |
| 225 | |
| 226 | EXPECT_EQ(op.invoke(*context_, props), OperatorResult::RUNNING_MODAL); |
| 227 | EXPECT_EQ(dispatch(op, |
| 228 | mouse_button(static_cast<int>(lfs::vis::input::AppMouseButton::LEFT), |
| 229 | lfs::vis::input::ACTION_PRESS, 30.0, 0.0), |
| 230 | props), |
| 231 | OperatorResult::RUNNING_MODAL); |
| 232 | EXPECT_EQ(dispatch(op, |
| 233 | mouse_button(static_cast<int>(lfs::vis::input::AppMouseButton::RIGHT), |
| 234 | lfs::vis::input::ACTION_PRESS, 30.0, 0.0), |
| 235 | props), |
| 236 | OperatorResult::PASS_THROUGH); |
| 237 | EXPECT_EQ(dispatch(op, |
| 238 | modal_action(lfs::vis::input::Action::UNDO_POLYGON_VERTEX), |
| 239 | props), |
| 240 | OperatorResult::RUNNING_MODAL); |
| 241 | EXPECT_TRUE(service().isInteractiveSelectionActive()); |
| 242 | |
| 243 | EXPECT_EQ(dispatch(op, key_press(lfs::vis::input::KEY_ESCAPE), props), OperatorResult::PASS_THROUGH); |
| 244 | op.cancel(*context_); |
| 245 | |
| 246 | EXPECT_EQ(selection_values(*scene_manager_), (std::vector<uint8_t>{1, 0})); |
| 247 | EXPECT_FALSE(service().isInteractiveSelectionActive()); |
| 248 | } |
| 249 | |
| 250 | TEST_F(SelectionOperatorModalTest, PolygonOperatorUsesConfiguredRightButtonForVertices) { |
| 251 | set_initial_selection({1, 0}); |
nothing calls this directly
no test coverage detected