Fixed theming bug in button and button group.

This commit is contained in:
2019-08-08 13:46:02 +02:00
parent cdc6461064
commit 97d33cf177
72 changed files with 255 additions and 844 deletions
+27 -72
View File
@@ -267,10 +267,6 @@
<span class="subtitle">Methods</span>
<li class="parent " data-name="ButtonGroup#_stackHorizontal"><a href="ButtonGroup.html#_stackHorizontal">_stackHorizontal</a></li>
<li class="parent " data-name="ButtonGroup#_stackVertical"><a href="ButtonGroup.html#_stackVertical">_stackVertical</a></li>
<li class="parent " data-name="ButtonGroup#capture"><a href="ButtonGroup.html#capture">capture</a></li>
<li class="parent " data-name="ButtonGroup#hide"><a href="ButtonGroup.html#hide">hide</a></li>
@@ -279,8 +275,6 @@
<li class="parent " data-name="ButtonGroup#show"><a href="ButtonGroup.html#show">show</a></li>
<li class="parent " data-name="ButtonGroup#stack"><a href="ButtonGroup.html#stack">stack</a></li>
</ul>
<ul class="events itemMembers">
@@ -1492,15 +1486,14 @@ export class DeepZoomInfo {
// number in the file system for the folder with tiles
this.clip = this.clip || null // e.g. { level: 12, col: 301436, row: 354060 }
this.type = this.type || 'dzi'
this.urlTileTemplate =
this.urlTileTemplate || '{path}/{level}/{column}_{row}.{format}'
this.urlTileTemplate = this.urlTileTemplate || '{path}/{level}/{column}_{row}.{format}'
this.setupDimensions()
}
/* Computes the needed number of layers from the width and height
* of the image. Note that this includes the level 0, i.e. 0 ... 4
* means that 5 levels exist.
**/
* of the image. Note that this includes the level 0, i.e. 0 ... 4
* means that 5 levels exist.
**/
numLevels() {
let maxDimension = Math.max(this.width, this.height)
let boundary = this.type === 'dzi' ? 1 : this.tileSize
@@ -1683,15 +1676,7 @@ export class DeepZoomInfo {
test() {
//console.log("w=" + this.width + " h=" + this.height + " maxlevel=" + this.maxLevel + " base=" + this.baseLevel)
for (let i = 0; i &lt;= this.maxLevel; i++) {
console.log(
' ' +
i +
' -> ' +
this.getScale(i) +
' [' +
this.dimensions(i) +
']'
)
console.log(' ' + i + ' -> ' + this.getScale(i) + ' [' + this.dimensions(i) + ']')
}
console.log(this.urlForTile(this.baseLevel, 0, 0))
}
@@ -1731,12 +1716,7 @@ class TileQuadNode {
**/
noQuads() {
if (this.previous === null) return false
return (
this.nw === null &amp;&amp;
this.ne === null &amp;&amp;
this.sw === null &amp;&amp;
this.se === null
)
return this.nw === null &amp;&amp; this.ne === null &amp;&amp; this.sw === null &amp;&amp; this.se === null
}
/** Unlink the given quad node
@@ -1775,7 +1755,6 @@ class TileQuadNode {
}
}
/**
* The main class of a deeply zoomable image that is represented by a hierarchy
* of tile layers for each zoom level. This gives the user the impression that
@@ -1793,7 +1772,7 @@ export class DeepZoomImage extends PIXI.Container {
debug = false,
shadow = false,
center = false,
world = null, // Defines the world bounds the images lives in
world = null, // Defines the world bounds the images lives in
highResolution = true,
autoLoadTiles = true,
useWorker = '',
@@ -1808,9 +1787,7 @@ export class DeepZoomImage extends PIXI.Container {
this.shadow = shadow
this.world = world
this.useWorker = useWorker
this.resolution = highResolution
? Math.round(window.devicePixelRatio)
: 1
this.resolution = highResolution ? Math.round(window.devicePixelRatio) : 1
this.alpha = alpha
this.fastLoads = 0
this.active = true
@@ -2000,7 +1977,7 @@ export class DeepZoomImage extends PIXI.Container {
**/
get maxScale() {
let delta = this.info.maxLevel - this.info.baseLevel
return Math.pow(2, delta) / this.resolution * 2
return (Math.pow(2, delta) / this.resolution) * 2
}
/** Getter for the current width.
@@ -2015,7 +1992,6 @@ export class DeepZoomImage extends PIXI.Container {
return this.pixelSize[1]
}
/* Overrides PIXI.Container.hitArea()
* Allows to optimize the hit testing. Container with hit areas are directly
* hit tested without consideration of children.
@@ -2085,7 +2061,7 @@ export class DeepZoomImage extends PIXI.Container {
}
worldBounds() {
let viewBounds = this.app.scene.bounds || this.app.scene.getBounds()
let viewBounds = this.app.scene.bounds || this.app.scene.getBounds()
// Using getBounds extends visible scope after loading tiles and leads
// to excessive loading. So we prefer bounds over getBounds()
if (this.world != null) {
@@ -2123,11 +2099,7 @@ export class DeepZoomImage extends PIXI.Container {
let topLeft = tiles.toLocal(worldTopLeft)
let bottomRight = tiles.toLocal(worldBottomRight)
tiles._centerPoint = tilesCenter
let bounds = new PIXI.Rectangle(
topLeft.x,
topLeft.y,
bottomRight.x - topLeft.x,
bottomRight.y - topLeft.y)
let bounds = new PIXI.Rectangle(topLeft.x, topLeft.y, bottomRight.x - topLeft.x, bottomRight.y - topLeft.y)
tiles._boundsRect = bounds
@@ -2172,9 +2144,6 @@ export class DeepZoomImage extends PIXI.Container {
return { centerCol, centerRow, needed }
}
/** Returns all changed tiles for a given level.
* @param {Tiles} tiles - the grid of tiles
* @param {number} level - The zoom level of the grid
@@ -2227,8 +2196,7 @@ export class DeepZoomImage extends PIXI.Container {
* @param {PIXI.Point} about - point of interaction
*/
populateTiles(tiles, level, { onlyone = false, about = null } = {}) {
if (tiles.isComplete())
return
if (tiles.isComplete()) return
let referenceCol = -1
let referenceRow = -1
let { centerCol, centerRow, changed } = this.changedTiles(tiles, level)
@@ -2239,8 +2207,7 @@ export class DeepZoomImage extends PIXI.Container {
let scaledTileSize = tiles.tileSize * tiles.tileScale
referenceCol = Math.floor(refPoint.x / scaledTileSize)
referenceRow = Math.floor(refPoint.y / scaledTileSize)
}
else {
} else {
referenceCol = centerCol
referenceRow = centerRow
}
@@ -2278,17 +2245,7 @@ export class DeepZoomImage extends PIXI.Container {
let [cols, rows, w, h] = this.info.dimensions(level)
let increasedLevels = level - this.info.baseLevel
let invScale = Math.pow(0.5, increasedLevels)
let tiles = new Tiles(
level,
this,
invScale,
cols,
rows,
w,
h,
this.info.tileSize,
this.info.overlap
)
let tiles = new Tiles(level, this, invScale, cols, rows, w, h, this.info.tileSize, this.info.overlap)
this.addTiles(key, tiles)
if (this.info.clip) {
let rest = this.info.rests[level]
@@ -2391,7 +2348,6 @@ export class DeepZoomImage extends PIXI.Container {
})
}
/**
* Destroy tiles in all layers that are no longer needed
*
@@ -2436,8 +2392,8 @@ export class DeepZoomImage extends PIXI.Container {
}
/* Tint all tiles
* @param {number} level - The zoom level of the grid
*/
* @param {number} level - The zoom level of the grid
*/
tintTilesBelowLevel(level) {
Object.keys(this.tileLayers).forEach(key => {
let tiles = this.tileLayers[key]
@@ -2449,7 +2405,7 @@ export class DeepZoomImage extends PIXI.Container {
/**
* Ensure that the given tiles layer is the topmost one and visible.
* @param {*} tiles
* @param {*} tiles
*/
bringTilesToFront(tiles) {
this.tileContainer.addChild(tiles)
@@ -2483,8 +2439,7 @@ export class DeepZoomImage extends PIXI.Container {
})
if (this.fastLoads == 3) {
this.fastLoads = 0
}
else {
} else {
return
}
}
@@ -2512,10 +2467,10 @@ export class DeepZoomImage extends PIXI.Container {
}
/**
*Activates the textures on the DeepZoomImage.
*
* @memberof DeepZoomImage
*/
*Activates the textures on the DeepZoomImage.
*
* @memberof DeepZoomImage
*/
activate() {
this.active = true
this.destroyTilesAboveLevel(this.currentLevel)
@@ -2524,10 +2479,10 @@ export class DeepZoomImage extends PIXI.Container {
}
/**
*Dectivates the textures on the DeepZoomImage.
*
* @memberof DeepZoomImage
*/
*Dectivates the textures on the DeepZoomImage.
*
* @memberof DeepZoomImage
*/
deactivate() {
this.active = false
this.destroyAllTiles()
@@ -2557,7 +2512,7 @@ export class DeepZoomImage extends PIXI.Container {
<footer class="content-size">
<div class="footer">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Tue Aug 06 2019 12:01:03 GMT+0200 (Mitteleuropäische Sommerzeit)
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Thu Aug 08 2019 13:45:13 GMT+0200 (Mitteleuropäische Sommerzeit)
</div>
</footer>
</div>