[gnome-characters] characterList: Optimize rendering when scrolling
- From: Daiki Ueno <dueno src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-characters] characterList: Optimize rendering when scrolling
- Date: Tue, 10 Feb 2015 10:01:17 +0000 (UTC)
commit ef1fa0c9b66174b881463439a08424b2c5576078
Author: Daiki Ueno <dueno src gnome org>
Date: Tue Feb 10 19:00:22 2015 +0900
characterList: Optimize rendering when scrolling
src/characterList.js | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/src/characterList.js b/src/characterList.js
index 2c95381..35e22e0 100644
--- a/src/characterList.js
+++ b/src/characterList.js
@@ -215,8 +215,12 @@ const CharacterListWidget = new Lang.Class({
// https://bugzilla.gnome.org/show_bug.cgi?id=700592
let allocation = this.get_allocation();
+ // Redraw rows within the clipped region.
+ let [x1, y1, x2, y2] = cr.clipExtents();
let cellSize = getCellSize(this._fontDescription);
- for (let index in this._rows) {
+ let start = Math.floor(y1 / cellSize);
+ let end = Math.ceil(y2 / cellSize);
+ for (let index = start; index < end; index++) {
this._rows[index].draw(cr, 0, index * cellSize,
allocation.width, cellSize);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]