Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(582)

Side by Side Diff: samplecode/OverView.cpp

Issue 1767683002: Ignore backspace when appending to the filter string in SampleApp. Fixes a bug on Windows where the… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Ignore *all* unprintable characters Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "OverView.h" 8 #include "OverView.h"
9 #include "SampleCode.h" 9 #include "SampleCode.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 bool onQuery(SkEvent* evt) override { 52 bool onQuery(SkEvent* evt) override {
53 if (SampleCode::TitleQ(*evt)) { 53 if (SampleCode::TitleQ(*evt)) {
54 SampleCode::TitleR(evt, "Overview"); 54 SampleCode::TitleR(evt, "Overview");
55 return true; 55 return true;
56 } 56 }
57 if (evt->isType(gIsOverview)) { 57 if (evt->isType(gIsOverview)) {
58 return true; 58 return true;
59 } 59 }
60 SkUnichar uni; 60 SkUnichar uni;
61 if (SampleCode::CharQ(*evt, &uni)) { 61 if (SampleCode::CharQ(*evt, &uni)) {
62 fMatchStr.appendUnichar(uni); 62 if (uni >= ' ') {
63 fMatchStr.appendUnichar(uni);
64 }
63 this->inval(nullptr); 65 this->inval(nullptr);
64 return true; 66 return true;
65 } 67 }
66 return this->INHERITED::onQuery(evt); 68 return this->INHERITED::onQuery(evt);
67 } 69 }
68 70
69 void onDraw(SkCanvas* canvas) override; 71 void onDraw(SkCanvas* canvas) override;
70 72
71 bool onSendClickToChildren(SkScalar x, SkScalar y, unsigned modi) override { 73 bool onSendClickToChildren(SkScalar x, SkScalar y, unsigned modi) override {
72 return false; 74 return false;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 SkPoint loc = this->start(); 166 SkPoint loc = this->start();
165 for (int i = 0; i < fCount; ++i) { 167 for (int i = 0; i < fCount; ++i) {
166 if (draw_this_name(fNames[i], fMatchStr)) { 168 if (draw_this_name(fNames[i], fMatchStr)) {
167 canvas->drawRect(this->bounds(loc), paint); 169 canvas->drawRect(this->bounds(loc), paint);
168 canvas->drawText(fNames[i].c_str(), fNames[i].size(), loc.x(), loc.y (), fNamePaint); 170 canvas->drawText(fNames[i].c_str(), fNames[i].size(), loc.x(), loc.y (), fNamePaint);
169 this->next(&loc); 171 this->next(&loc);
170 } 172 }
171 } 173 }
172 } 174 }
173 175
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698