Skip to content

Commit

Permalink
Allow the UI to be scaled, and fix a scroll to bottom bug when the UI…
Browse files Browse the repository at this point in the history
… is being scaled up
  • Loading branch information
sedwards2009 committed May 26, 2017
1 parent 9097a14 commit a22a88a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
4 changes: 0 additions & 4 deletions src/Main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,7 @@ function main(): void {
let failed = false;

app.commandLine.appendSwitch('disable-smooth-scrolling'); // Turn off the sluggish scrolling.

// Turn off the HiDPI automatic UI scaling. It actually causes a rendering glitch in the
// tab in the atomic light theme.
app.commandLine.appendSwitch('high-dpi-support', 'true');
app.commandLine.appendSwitch('force-device-scale-factor', '1');

if (process.platform === "darwin") {
setupOSX();
Expand Down
5 changes: 3 additions & 2 deletions src/VirtualScrollArea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,8 +511,9 @@ export class VirtualScrollArea {
const newState = _.clone(this._currentState);
newState.scrollableStates = this._currentState.scrollableStates.map<VirtualScrollableState>(_.clone.bind(_));

const virtualHeight = TotalVirtualHeight(this._currentState);
const isAtBottom = this._currentState.virtualScrollYOffset >= virtualHeight - this._currentState.containerHeight;
const virtualHeight = TotalVirtualHeight(this._currentState);
const TOLERANCE = 4;
const isAtBottom = (this._currentState.virtualScrollYOffset + TOLERANCE) >= virtualHeight - this._currentState.containerHeight;

for (let i=0; i<mutator.length; i++) {
mutator[i](newState);
Expand Down

0 comments on commit a22a88a

Please sign in to comment.