Flutter Engine
 
Loading...
Searching...
No Matches
widgets.h
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef FLUTTER_IMPELLER_PLAYGROUND_WIDGETS_H_
6#define FLUTTER_IMPELLER_PLAYGROUND_WIDGETS_H_
7
8#include <optional>
9#include <tuple>
10
14#include "third_party/imgui/imgui.h"
15
16namespace impeller {
17// A point on the screen that can be dragged.
18//
19// Instances of this class should be preserved between frames, such as being
20// static variables.
22 PlaygroundPoint(Point default_position, Scalar p_radius, Color p_color)
23 : position(default_position),
24 reset_position(default_position),
25 radius(p_radius),
26 color(p_color) {}
29 bool dragging = false;
30 std::optional<Point> prev_mouse_pos;
36};
37
39
40std::tuple<Point, Point> DrawPlaygroundLine(PlaygroundPoint& point_a,
41 PlaygroundPoint& point_b);
42} // namespace impeller
43#endif // FLUTTER_IMPELLER_PLAYGROUND_WIDGETS_H_
float Scalar
Definition scalar.h:19
Point DrawPlaygroundPoint(PlaygroundPoint &point)
Definition widgets.cc:11
std::tuple< Point, Point > DrawPlaygroundLine(PlaygroundPoint &point_a, PlaygroundPoint &point_b)
Definition widgets.cc:51
PlaygroundPoint(const PlaygroundPoint &)=delete
PlaygroundPoint & operator=(const PlaygroundPoint &)=delete
PlaygroundPoint(Point default_position, Scalar p_radius, Color p_color)
Definition widgets.h:22
PlaygroundPoint(PlaygroundPoint &&)=delete
std::optional< Point > prev_mouse_pos
Definition widgets.h:30