mirror of
https://github.com/Myxelium/Bridge-Multi.git
synced 2026-04-11 14:19:38 +00:00
Add zoom setting
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import { DOCUMENT } from '@angular/common'
|
||||
import { Inject, Injectable } from '@angular/core'
|
||||
|
||||
import _ from 'lodash'
|
||||
import { Difficulty, Instrument } from 'scan-chart'
|
||||
|
||||
import { Settings, themes } from '../../../../src-shared/Settings'
|
||||
import { Settings, themes } from '../../../../src-shared/Settings.js'
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
@@ -90,4 +91,20 @@ export class SettingsService {
|
||||
this.settings.isCompactTable = value
|
||||
this.saveSettings()
|
||||
}
|
||||
|
||||
get zoomFactor() {
|
||||
return this.settings.zoomFactor
|
||||
}
|
||||
set zoomFactor(value: number) {
|
||||
this.settings.zoomFactor = value
|
||||
this.saveSettings()
|
||||
}
|
||||
zoomIn() {
|
||||
this.zoomFactor = _.round(this.zoomFactor + 0.1, 3)
|
||||
}
|
||||
zoomOut() {
|
||||
if (_.round(this.zoomFactor - 0.1, 3) > 0) {
|
||||
this.zoomFactor = _.round(this.zoomFactor - 0.1, 3)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user