This commit is contained in:
dabreegster 2022-11-09 12:13:05 +00:00
parent ea6207635d
commit a1a7219bee
11 changed files with 30 additions and 24 deletions

View File

@ -1,2 +1,2 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The build time in RFC2822, UTC."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>BUILT_TIME_UTC in map_gui::tools::title_screen::built_info - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../../../normalize.css"><link rel="stylesheet" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../../../ayu.css" disabled><link rel="stylesheet" href="../../../../dark.css" disabled><link rel="stylesheet" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../main.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../../../map_gui/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../../../map_gui/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In map_gui::tools::title_screen::built_info</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../map_gui/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">map_gui</a>::<wbr><a href="../../index.html">tools</a>::<wbr><a href="../index.html">title_screen</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="#">BUILT_TIME_UTC</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/map_gui/home/runner/work/abstreet/abstreet/target/debug/build/map_gui-63c5bcb4b09cf8fd/out/built.rs.html#78">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>pub const BUILT_TIME_UTC: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/1.65.0/std/primitive.str.html">str</a> = r&quot;Tue, 08 Nov 2022 22:35:54 +0000&quot;;</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The build time in RFC2822, UTC.</p>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The build time in RFC2822, UTC."><meta name="keywords" content="rust, rustlang, rust-lang, BUILT_TIME_UTC"><title>BUILT_TIME_UTC in map_gui::tools::title_screen::built_info - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../../../normalize.css"><link rel="stylesheet" href="../../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../../../ayu.css" disabled><link rel="stylesheet" href="../../../../dark.css" disabled><link rel="stylesheet" href="../../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../../../main.js"></script><noscript><link rel="stylesheet" href="../../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../../favicon.svg"></head><body class="rustdoc constant"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../../../map_gui/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../../../map_gui/index.html"><div class="logo-container"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></div></a><div class="sidebar-elems"><h2 class="location"><a href="index.html">In map_gui::tools::title_screen::built_info</a></h2></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../../map_gui/index.html"><img class="rust-logo" src="../../../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Constant <a href="../../../index.html">map_gui</a>::<wbr><a href="../../index.html">tools</a>::<wbr><a href="../index.html">title_screen</a>::<wbr><a href="index.html">built_info</a>::<wbr><a class="constant" href="#">BUILT_TIME_UTC</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../../src/map_gui/home/runner/work/abstreet/abstreet/target/debug/build/map_gui-63c5bcb4b09cf8fd/out/built.rs.html#78">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="docblock item-decl"><pre class="rust const"><code>pub const BUILT_TIME_UTC: &amp;'static <a class="primitive" href="https://doc.rust-lang.org/1.65.0/std/primitive.str.html">str</a> = r&quot;Wed, 09 Nov 2022 12:11:28 +0000&quot;;</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The build time in RFC2822, UTC.</p>
</div></details></section></div></main><div id="rustdoc-vars" data-root-path="../../../../" data-current-crate="map_gui" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.65.0 (897e37553 2022-11-02)" ></div></body></html>

File diff suppressed because one or more lines are too long

View File

@ -675,7 +675,7 @@
}
<span class="string">&quot;Draw freehand&quot; </span>=&gt; {
<span class="kw">return </span>Transition::Push(Box::new(DrawFreehand {
lasso: Lasso::new(),
lasso: Lasso::new(Distance::meters(<span class="number">1.0</span>)),
new_idx: <span class="self">self</span>.story.markers.len(),
}));
}

View File

@ -427,7 +427,7 @@
<span class="kw">use </span>anyhow::Result;
<span class="kw">use </span>geom::Polygon;
<span class="kw">use </span>geom::{Distance, Polygon};
<span class="kw">use </span>map_gui::tools::DrawSimpleRoadLabels;
<span class="kw">use </span>widgetry::mapspace::{World, WorldOutcome};
<span class="kw">use </span>widgetry::tools::{Lasso, PopupMsg};
@ -723,7 +723,7 @@
));
}
<span class="string">&quot;Select freehand&quot; </span>=&gt; {
<span class="self">self</span>.lasso = <span class="prelude-val">Some</span>(Lasso::new());
<span class="self">self</span>.lasso = <span class="prelude-val">Some</span>(Lasso::new(Distance::meters(<span class="number">1.0</span>)));
<span class="self">self</span>.left_panel = make_panel_for_lasso(ctx, <span class="kw-2">&amp;</span><span class="self">self</span>.appwide_panel.top_panel);
}
<span class="kw">_ </span>=&gt; <span class="macro">unreachable!</span>(),

View File

@ -174,7 +174,7 @@
</span><span class="kw">pub const </span>RUSTDOC_VERSION: <span class="kw-2">&amp;</span>str = <span class="string">r&quot;rustdoc 1.65.0 (897e37553 2022-11-02)&quot;</span>;
<span class="attribute">#[doc=<span class="string">r#&quot;The build time in RFC2822, UTC.&quot;#</span>]
#[allow(dead_code)]
</span><span class="kw">pub const </span>BUILT_TIME_UTC: <span class="kw-2">&amp;</span>str = <span class="string">r&quot;Tue, 08 Nov 2022 22:35:54 +0000&quot;</span>;
</span><span class="kw">pub const </span>BUILT_TIME_UTC: <span class="kw-2">&amp;</span>str = <span class="string">r&quot;Wed, 09 Nov 2022 12:11:28 +0000&quot;</span>;
<span class="attribute">#[doc=<span class="string">r#&quot;The target architecture, given by `CARGO_CFG_TARGET_ARCH`.&quot;#</span>]
#[allow(dead_code)]
</span><span class="kw">pub const </span>CFG_TARGET_ARCH: <span class="kw-2">&amp;</span>str = <span class="string">r&quot;x86_64&quot;</span>;

View File

@ -107,6 +107,7 @@
<span id="107">107</span>
<span id="108">108</span>
<span id="109">109</span>
<span id="110">110</span>
</pre><pre class="rust"><code><span class="kw">use </span>geom::{Distance, PolyLine, Polygon, Pt2D, Ring};
<span class="kw">use crate</span>::{Color, EventCtx, GfxCtx};
@ -117,13 +118,16 @@
</span><span class="kw">pub struct </span>Lasso {
points: Vec&lt;Pt2D&gt;,
polygon: <span class="prelude-ty">Option</span>&lt;Polygon&gt;,
threshold: Distance,
}
<span class="kw">impl </span>Lasso {
<span class="kw">pub fn </span>new() -&gt; <span class="self">Self </span>{
<span class="doccomment">/// How far do points need to be spaced apart to add?
</span><span class="kw">pub fn </span>new(threshold: Distance) -&gt; <span class="self">Self </span>{
<span class="self">Self </span>{
points: Vec::new(),
polygon: <span class="prelude-val">None</span>,
threshold,
}
}
@ -144,16 +148,14 @@
<span class="kw">if </span>ctx.redo_mouseover() {
<span class="kw">if let </span><span class="prelude-val">Some</span>(pt) = ctx.canvas.get_cursor_in_map_space() {
<span class="kw">if </span><span class="self">self</span>.points.last().as_ref().unwrap().dist_to(pt) &gt; Distance::meters(<span class="number">0.1</span>) {
<span class="kw">if </span><span class="self">self</span>.points.last().as_ref().unwrap().dist_to(pt) &gt; <span class="self">self</span>.threshold {
<span class="self">self</span>.points.push(pt);
<span class="comment">// TODO It&#39;s better if the user doesn&#39;t close the polygon themselves. When they
// try to, usually the result is the smaller polygon chunk
</span><span class="kw">let </span><span class="kw-2">mut </span>copy = <span class="self">self</span>.points.clone();
copy.push(copy[<span class="number">0</span>]);
<span class="self">self</span>.polygon = Ring::new(copy)
.ok()
.map(|ring| ring.into_polygon().simplify(<span class="number">1.0</span>));
<span class="self">self</span>.polygon = Ring::new(copy).ok().map(|ring| ring.into_polygon());
}
}
}

View File

@ -1 +1 @@
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `lasso` mod in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, lasso"><title>widgetry::tools::lasso - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../../normalize.css"><link rel="stylesheet" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../../ayu.css" disabled><link rel="stylesheet" href="../../../dark.css" disabled><link rel="stylesheet" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script defer src="../../../main.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../../widgetry/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../../widgetry/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Module lasso</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../widgetry/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">widgetry</a>::<wbr><a href="../index.html">tools</a>::<wbr><a class="mod" href="#">lasso</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/widgetry/tools/lasso.rs.html#1-109">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Lasso.html" title="widgetry::tools::lasso::Lasso struct">Lasso</a></div><div class="item-right docblock-short">Draw freehand polygons</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.PolyLineLasso.html" title="widgetry::tools::lasso::PolyLineLasso struct">PolyLineLasso</a></div><div class="item-right docblock-short">Draw freehand PolyLine</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="widgetry" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.65.0 (897e37553 2022-11-02)" ></div></body></html>
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="API documentation for the Rust `lasso` mod in crate `widgetry`."><meta name="keywords" content="rust, rustlang, rust-lang, lasso"><title>widgetry::tools::lasso - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../../normalize.css"><link rel="stylesheet" href="../../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../../ayu.css" disabled><link rel="stylesheet" href="../../../dark.css" disabled><link rel="stylesheet" href="../../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../../storage.js"></script><script defer src="../../../main.js"></script><noscript><link rel="stylesheet" href="../../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../../favicon.svg"></head><body class="rustdoc mod"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../../widgetry/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div></a><h2 class="location"></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../../widgetry/index.html"><div class="logo-container"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">Module lasso</a></h2><div class="sidebar-elems"><section><div class="block"><ul><li><a href="#structs">Structs</a></li></ul></div></section></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../../../widgetry/index.html"><img class="rust-logo" src="../../../rust-logo.svg" alt="logo"></a><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><button type="button">?</button></div><div id="settings-menu" tabindex="-1"><a href="../../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../../wheel.svg"></a></div></div></form></nav></div><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn"><span class="in-band">Module <a href="../../index.html">widgetry</a>::<wbr><a href="../index.html">tools</a>::<wbr><a class="mod" href="#">lasso</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></span></h1><span class="out-of-band"><a class="srclink" href="../../../src/widgetry/tools/lasso.rs.html#1-110">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><h2 id="structs" class="small-section-header"><a href="#structs">Structs</a></h2><div class="item-table"><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.Lasso.html" title="widgetry::tools::lasso::Lasso struct">Lasso</a></div><div class="item-right docblock-short">Draw freehand polygons</div></div><div class="item-row"><div class="item-left module-item"><a class="struct" href="struct.PolyLineLasso.html" title="widgetry::tools::lasso::PolyLineLasso struct">PolyLineLasso</a></div><div class="item-right docblock-short">Draw freehand PolyLine</div></div></div></section></div></main><div id="rustdoc-vars" data-root-path="../../../" data-current-crate="widgetry" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.65.0 (897e37553 2022-11-02)" ></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long