Skip to content

Commit f156599

Browse files
committed
Remove trailing blanks.
1 parent 1f7a8c0 commit f156599

File tree

4 files changed

+31
-31
lines changed

4 files changed

+31
-31
lines changed

implot.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Below is a change-log of API breaking changes only. If you are using one of the
3131
When you are not sure about a old symbol or function name, try using the Search/Find function of your IDE to look for comments or references in all implot files.
3232
You can read releases logs https://github.com/epezent/implot/releases for more details.
3333
34-
- 2023/08/20 (0.17) - ImPlotFlags_NoChild was removed as child windows are no longer needed to capture scroll. You can safely remove this flag if you were using it.
34+
- 2023/08/20 (0.17) - ImPlotFlags_NoChild was removed as child windows are no longer needed to capture scroll. You can safely remove this flag if you were using it.
3535
- 2023/06/26 (0.15) - Various build fixes related to updates in Dear ImGui internals.
3636
- 2022/11/25 (0.15) - Make PlotText honor ImPlotItemFlags_NoFit.
3737
- 2022/06/19 (0.14) - The signature of ColormapScale has changed to accommodate a new ImPlotColormapScaleFlags parameter
@@ -604,10 +604,10 @@ bool ClampLegendRect(ImRect& legend_rect, const ImRect& outer_rect, const ImVec2
604604
if (legend_rect.Max.y > outer_rect_pad.Max.y) {
605605
legend_rect.Max.y = outer_rect_pad.Max.y;
606606
clamped = true;
607-
}
607+
}
608608
return clamped;
609609
}
610-
610+
611611
int LegendSortingComp(const void* _a, const void* _b) {
612612
ImPlotItemGroup* items = GImPlot->SortItems;
613613
const int a = *(const int*)_a;
@@ -1982,9 +1982,9 @@ bool UpdateInput(ImPlotPlot& plot) {
19821982
if (any_hov && ImHasFlag(IO.KeyMods, gp.InputMap.ZoomMod)) {
19831983

19841984
float zoom_rate = gp.InputMap.ZoomRate;
1985-
if (IO.MouseWheel == 0.0f)
1986-
zoom_rate = 0;
1987-
else if (IO.MouseWheel > 0)
1985+
if (IO.MouseWheel == 0.0f)
1986+
zoom_rate = 0;
1987+
else if (IO.MouseWheel > 0)
19881988
zoom_rate = (-zoom_rate) / (1.0f + (2.0f * zoom_rate));
19891989
ImVec2 rect_size = plot.PlotRect.GetSize();
19901990
float tx = ImRemap(IO.MousePos.x, plot.PlotRect.Min.x, plot.PlotRect.Max.x, 0.0f, 1.0f);
@@ -2451,7 +2451,7 @@ bool BeginPlot(const char* title_id, const ImVec2& size, ImPlotFlags flags) {
24512451
ResetCtxForNextPlot(GImPlot);
24522452
return false;
24532453
}
2454-
2454+
24552455
// setup items (or dont)
24562456
if (gp.CurrentItems == nullptr)
24572457
gp.CurrentItems = &plot.Items;
@@ -3047,7 +3047,7 @@ void EndPlot() {
30473047
const bool legend_scrollable = ClampLegendRect(legend.RectClamped,
30483048
legend_out ? plot.FrameRect : plot.PlotRect,
30493049
legend_out ? gp.Style.PlotPadding : gp.Style.LegendPadding
3050-
);
3050+
);
30513051
const ImGuiButtonFlags legend_button_flags = ImGuiButtonFlags_AllowOverlap
30523052
| ImGuiButtonFlags_PressedOnClick
30533053
| ImGuiButtonFlags_PressedOnDoubleClick
@@ -3058,7 +3058,7 @@ void EndPlot() {
30583058
ImGui::KeepAliveID(plot.Items.ID);
30593059
ImGui::ButtonBehavior(legend.RectClamped, plot.Items.ID, &legend.Hovered, &legend.Held, legend_button_flags);
30603060
legend.Hovered = legend.Hovered || (ImGui::IsWindowHovered() && legend.RectClamped.Contains(IO.MousePos));
3061-
3061+
30623062
if (legend_scrollable) {
30633063
if (legend.Hovered) {
30643064
ImGui::SetKeyOwner(ImGuiKey_MouseWheelY, plot.Items.ID);
@@ -3069,10 +3069,10 @@ void EndPlot() {
30693069
legend.Scroll.x += scroll_step * IO.MouseWheel;
30703070
legend.Scroll.y += scroll_step * IO.MouseWheel;
30713071
}
3072-
}
3072+
}
30733073
const ImVec2 min_scroll_offset = legend.RectClamped.GetSize() - legend.Rect.GetSize();
30743074
legend.Scroll.x = ImClamp(legend.Scroll.x, min_scroll_offset.x, 0.0f);
3075-
legend.Scroll.y = ImClamp(legend.Scroll.y, min_scroll_offset.y, 0.0f);
3075+
legend.Scroll.y = ImClamp(legend.Scroll.y, min_scroll_offset.y, 0.0f);
30763076
const ImVec2 scroll_offset = legend_horz ? ImVec2(legend.Scroll.x, 0) : ImVec2(0, legend.Scroll.y);
30773077
ImVec2 legend_offset = legend.RectClamped.Min - legend.Rect.Min + scroll_offset;
30783078
legend.Rect.Min += legend_offset;
@@ -3082,18 +3082,18 @@ void EndPlot() {
30823082
}
30833083

30843084
const ImU32 col_bg = GetStyleColorU32(ImPlotCol_LegendBg);
3085-
const ImU32 col_bd = GetStyleColorU32(ImPlotCol_LegendBorder);
3086-
ImGui::PushClipRect(legend.RectClamped.Min, legend.RectClamped.Max, true);
3087-
DrawList.AddRectFilled(legend.RectClamped.Min, legend.RectClamped.Max, col_bg);
3085+
const ImU32 col_bd = GetStyleColorU32(ImPlotCol_LegendBorder);
3086+
ImGui::PushClipRect(legend.RectClamped.Min, legend.RectClamped.Max, true);
3087+
DrawList.AddRectFilled(legend.RectClamped.Min, legend.RectClamped.Max, col_bg);
30883088
bool legend_contextable = ShowLegendEntries(plot.Items, legend.Rect, legend.Hovered, gp.Style.LegendInnerPadding, gp.Style.LegendSpacing, !legend_horz, DrawList)
3089-
&& !ImHasFlag(legend.Flags, ImPlotLegendFlags_NoMenus);
3089+
&& !ImHasFlag(legend.Flags, ImPlotLegendFlags_NoMenus);
30903090
DrawList.AddRect(legend.RectClamped.Min, legend.RectClamped.Max, col_bd);
30913091
ImGui::PopClipRect();
30923092

30933093
// main ctx menu
30943094
if (gp.OpenContextThisFrame && legend_contextable && !ImHasFlag(plot.Flags, ImPlotFlags_NoMenus))
3095-
ImGui::OpenPopup("##LegendContext");
3096-
3095+
ImGui::OpenPopup("##LegendContext");
3096+
30973097
if (ImGui::BeginPopup("##LegendContext")) {
30983098
ImGui::Text("Legend"); ImGui::Separator();
30993099
if (ShowLegendContextMenu(legend, !ImHasFlag(plot.Flags, ImPlotFlags_NoLegend)))
@@ -3566,7 +3566,7 @@ void EndSubplots() {
35663566
const ImVec2 legend_pos = GetLocationPos(subplot.FrameRect, legend_size, legend.Location, gp.Style.PlotPadding);
35673567
legend.Rect = ImRect(legend_pos, legend_pos + legend_size);
35683568
legend.RectClamped = legend.Rect;
3569-
const bool legend_scrollable = ClampLegendRect(legend.RectClamped,subplot.FrameRect, gp.Style.PlotPadding);
3569+
const bool legend_scrollable = ClampLegendRect(legend.RectClamped,subplot.FrameRect, gp.Style.PlotPadding);
35703570
const ImGuiButtonFlags legend_button_flags = ImGuiButtonFlags_AllowOverlap
35713571
| ImGuiButtonFlags_PressedOnClick
35723572
| ImGuiButtonFlags_PressedOnDoubleClick
@@ -3577,7 +3577,7 @@ void EndSubplots() {
35773577
ImGui::KeepAliveID(subplot.Items.ID);
35783578
ImGui::ButtonBehavior(legend.RectClamped, subplot.Items.ID, &legend.Hovered, &legend.Held, legend_button_flags);
35793579
legend.Hovered = legend.Hovered || (subplot.FrameHovered && legend.RectClamped.Contains(ImGui::GetIO().MousePos));
3580-
3580+
35813581
if (legend_scrollable) {
35823582
if (legend.Hovered) {
35833583
ImGui::SetKeyOwner(ImGuiKey_MouseWheelY, subplot.Items.ID);
@@ -3588,10 +3588,10 @@ void EndSubplots() {
35883588
legend.Scroll.x += scroll_step * IO.MouseWheel;
35893589
legend.Scroll.y += scroll_step * IO.MouseWheel;
35903590
}
3591-
}
3591+
}
35923592
const ImVec2 min_scroll_offset = legend.RectClamped.GetSize() - legend.Rect.GetSize();
35933593
legend.Scroll.x = ImClamp(legend.Scroll.x, min_scroll_offset.x, 0.0f);
3594-
legend.Scroll.y = ImClamp(legend.Scroll.y, min_scroll_offset.y, 0.0f);
3594+
legend.Scroll.y = ImClamp(legend.Scroll.y, min_scroll_offset.y, 0.0f);
35953595
const ImVec2 scroll_offset = legend_horz ? ImVec2(legend.Scroll.x, 0) : ImVec2(0, legend.Scroll.y);
35963596
ImVec2 legend_offset = legend.RectClamped.Min - legend.Rect.Min + scroll_offset;
35973597
legend.Rect.Min += legend_offset;
@@ -3602,13 +3602,13 @@ void EndSubplots() {
36023602

36033603
const ImU32 col_bg = GetStyleColorU32(ImPlotCol_LegendBg);
36043604
const ImU32 col_bd = GetStyleColorU32(ImPlotCol_LegendBorder);
3605-
ImGui::PushClipRect(legend.RectClamped.Min, legend.RectClamped.Max, true);
3606-
DrawList.AddRectFilled(legend.RectClamped.Min, legend.RectClamped.Max, col_bg);
3605+
ImGui::PushClipRect(legend.RectClamped.Min, legend.RectClamped.Max, true);
3606+
DrawList.AddRectFilled(legend.RectClamped.Min, legend.RectClamped.Max, col_bg);
36073607
bool legend_contextable = ShowLegendEntries(subplot.Items, legend.Rect, legend.Hovered, gp.Style.LegendInnerPadding, gp.Style.LegendSpacing, !legend_horz, DrawList)
36083608
&& !ImHasFlag(legend.Flags, ImPlotLegendFlags_NoMenus);
36093609
DrawList.AddRect(legend.RectClamped.Min, legend.RectClamped.Max, col_bd);
36103610
ImGui::PopClipRect();
3611-
3611+
36123612
if (legend_contextable && !ImHasFlag(subplot.Flags, ImPlotSubplotFlags_NoMenus) && ImGui::GetIO().MouseReleased[gp.InputMap.Menu])
36133613
ImGui::OpenPopup("##LegendContext");
36143614
if (ImGui::BeginPopup("##LegendContext")) {

implot_demo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@ void Demo_LegendOptions() {
13861386

13871387
static int num_dummy_items = 25;
13881388
ImGui::SliderInt("Num Dummy Items (Demo Scrolling)", &num_dummy_items, 0, 100);
1389-
1389+
13901390
if (ImPlot::BeginPlot("##Legend",ImVec2(-1,0))) {
13911391
ImPlot::SetupLegend(loc, flags);
13921392
static MyImPlot::WaveData data1(0.001, 0.2, 4, 0.2);
@@ -1405,11 +1405,11 @@ void Demo_LegendOptions() {
14051405
char label[16];
14061406
snprintf(label, sizeof(label), "Item %03d", i+4);
14071407
ImPlot::PlotDummy(label);
1408-
}
1408+
}
14091409
ImPlot::EndPlot();
14101410
}
1411-
}
1412-
1411+
}
1412+
14131413
//-----------------------------------------------------------------------------
14141414

14151415
void Demo_DragPoints() {

implot_internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1417,7 +1417,7 @@ IMPLOT_API ImVec2 GetLocationPos(const ImRect& outer_rect, const ImVec2& inner_s
14171417
// Calculates the bounding box size of a legend _before_ clipping.
14181418
IMPLOT_API ImVec2 CalcLegendSize(ImPlotItemGroup& items, const ImVec2& pad, const ImVec2& spacing, bool vertical);
14191419
// Clips calculated legend size
1420-
IMPLOT_API bool ClampLegendRect(ImRect& legend_rect, const ImRect& outer_rect, const ImVec2& pad);
1420+
IMPLOT_API bool ClampLegendRect(ImRect& legend_rect, const ImRect& outer_rect, const ImVec2& pad);
14211421
// Renders legend entries into a bounding box
14221422
IMPLOT_API bool ShowLegendEntries(ImPlotItemGroup& items, const ImRect& legend_bb, bool interactable, const ImVec2& pad, const ImVec2& spacing, bool vertical, ImDrawList& DrawList);
14231423
// Shows an alternate legend for the plot identified by #title_id, outside of the plot frame (can be called before or after of Begin/EndPlot but must occur in the same ImGui window! This is not thoroughly tested nor scrollable!).

implot_items.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2243,11 +2243,11 @@ double PieChartSum(const T* values, int count, bool ignore_hidden) {
22432243
template <typename T>
22442244
void PlotPieChartEx(const char* const label_ids[], const T* values, int count, ImPlotPoint center, double radius, double angle0, ImPlotPieChartFlags flags) {
22452245
ImDrawList& draw_list = *GetPlotDrawList();
2246-
2246+
22472247
const bool ignore_hidden = ImHasFlag(flags, ImPlotPieChartFlags_IgnoreHidden);
22482248
const double sum = PieChartSum(values, count, ignore_hidden);
22492249
const bool normalize = ImHasFlag(flags, ImPlotPieChartFlags_Normalize) || sum > 1.0;
2250-
2250+
22512251
double a0 = angle0 * 2 * IM_PI / 360.0;
22522252
double a1 = angle0 * 2 * IM_PI / 360.0;
22532253
ImPlotPoint Pmin = ImPlotPoint(center.x - radius, center.y - radius);

0 commit comments

Comments
 (0)