Commit bb223291 authored by pkasting's avatar pkasting Committed by Commit bot

Disallow non-postive sizes in vector icon views example.

This is mostly a follow-up to an unintentional behavior change in
https://codereview.chromium.org/2255403002/ .  I decided to treat 0 size as
invalid as well.

BUG=none
TEST=none

Review-Url: https://codereview.chromium.org/2278743002
Cr-Commit-Position: refs/heads/master@{#414215}
parent b7132308
...@@ -97,7 +97,7 @@ class VectorIconGallery : public View, ...@@ -97,7 +97,7 @@ class VectorIconGallery : public View,
void ContentsChanged(Textfield* sender, void ContentsChanged(Textfield* sender,
const base::string16& new_contents) override { const base::string16& new_contents) override {
if (sender == size_input_) { if (sender == size_input_) {
if (base::StringToInt(new_contents, &size_)) if (base::StringToInt(new_contents, &size_) && (size_ > 0))
UpdateImage(); UpdateImage();
else else
size_input_->SetText(base::string16()); size_input_->SetText(base::string16());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment