Implemented stacked button groups.
This commit is contained in:
@@ -263,12 +263,20 @@
|
||||
|
||||
<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>
|
||||
|
||||
<li class="parent " data-name="ButtonGroup#layout"><a href="ButtonGroup.html#layout">layout</a></li>
|
||||
|
||||
<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">
|
||||
|
||||
@@ -1517,15 +1525,9 @@ export class Hypenate {
|
||||
let first = true
|
||||
let lastPart = ''
|
||||
for (let part of parts) {
|
||||
let partMetrics = PIXI.TextMetrics.measureText(
|
||||
part,
|
||||
pixiStyle
|
||||
)
|
||||
let partMetrics = PIXI.TextMetrics.measureText(part, pixiStyle)
|
||||
if (x + partMetrics.width + space.width > width) {
|
||||
newWord +=
|
||||
(first || lastPart.endsWith('-')
|
||||
? '\n'
|
||||
: '-\n') + part
|
||||
newWord += (first || lastPart.endsWith('-') ? '\n' : '-\n') + part
|
||||
x = partMetrics.width
|
||||
} else {
|
||||
newWord += part
|
||||
@@ -1576,12 +1578,7 @@ class TextLabel extends PIXI.Text {
|
||||
* @param {canvas}
|
||||
* @memberof TextLabel
|
||||
*/
|
||||
constructor(
|
||||
text,
|
||||
style = null,
|
||||
canvas = null,
|
||||
{ minZoom = 0.1, maxZoom = 10 } = {}
|
||||
) {
|
||||
constructor(text, style = null, canvas = null, { minZoom = 0.1, maxZoom = 10 } = {}) {
|
||||
super(text, style, canvas)
|
||||
this.normFontSize = this.style.fontSize
|
||||
this.minZoom = minZoom
|
||||
@@ -1730,21 +1727,11 @@ export class LabeledGraphics extends PIXI.Graphics {
|
||||
const truncatedLines = lines.slice(0, maxLines)
|
||||
const lastLine = truncatedLines[truncatedLines.length - 1]
|
||||
const words = lastLine.split(' ')
|
||||
const wordMetrics = PIXI.TextMetrics.measureText(
|
||||
`\u00A0\n...\n${words.join('\n')}`,
|
||||
pixiStyle
|
||||
)
|
||||
const [
|
||||
spaceLength,
|
||||
dotsLength,
|
||||
...wordLengths
|
||||
] = wordMetrics.lineWidths
|
||||
const wordMetrics = PIXI.TextMetrics.measureText(`\u00A0\n...\n${words.join('\n')}`, pixiStyle)
|
||||
const [spaceLength, dotsLength, ...wordLengths] = wordMetrics.lineWidths
|
||||
const { text: newLastLine } = wordLengths.reduce(
|
||||
(data, wordLength, i) => {
|
||||
if (
|
||||
data.length + wordLength + spaceLength >=
|
||||
wordWrapWidth
|
||||
) {
|
||||
if (data.length + wordLength + spaceLength >= wordWrapWidth) {
|
||||
return { ...data, length: wordWrapWidth }
|
||||
}
|
||||
return {
|
||||
@@ -1870,7 +1857,7 @@ export class BitmapLabeledGraphics extends LabeledGraphics {
|
||||
|
||||
<footer class="content-size">
|
||||
<div class="footer">
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Tue Jul 30 2019 10:48:36 GMT+0200 (Mitteleuropäische Sommerzeit)
|
||||
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.6.3</a> on Wed Jul 31 2019 15:00:47 GMT+0200 (Mitteleuropäische Sommerzeit)
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user