public static Rectangle peekScissors () { return scissors.peek(); }
public static Rectangle peekScissors () { return scissors.peek(); }
private void endRow () { Array<Cell> cells = this.cells; int rowColumns = 0; for (int i = cells.size - 1; i >= 0; i--) { Cell cell = cells.get(i); if (cell.endRow) break; rowColumns += cell.colspan; } columns = Math.max(columns, rowColumns); rows++; cells.peek().endRow = true; }
private void endRow () { Array<Cell> cells = this.cells; int rowColumns = 0; for (int i = cells.size - 1; i >= 0; i--) { Cell cell = cells.get(i); if (cell.endRow) break; rowColumns += cell.colspan; } columns = Math.max(columns, rowColumns); rows++; cells.peek().endRow = true; }
protected void close () { root = elements.pop(); current = elements.size > 0 ? elements.peek() : null; }
protected void close () { root = elements.pop(); current = elements.size > 0 ? elements.peek() : null; }
public JsonWriter pop () throws IOException { if (named) throw new IllegalStateException("Expected an object, array, or value since a name was set."); stack.pop().close(); current = stack.size == 0 ? null : stack.peek(); return this; }
public JsonWriter pop () throws IOException { if (named) throw new IllegalStateException("Expected an object, array, or value since a name was set."); stack.pop().close(); current = stack.size == 0 ? null : stack.peek(); return this; }
/** Adjusts the xadvance of the last glyph to use its width instead of xadvance. */ private void adjustLastGlyph (BitmapFontData fontData, GlyphRun run) { Glyph last = run.glyphs.peek(); if (last.fixedWidth) return; float width = (last.width + last.xoffset) * fontData.scaleX - fontData.padRight; run.width += width - run.xAdvances.peek(); // Can cause the run width to be > targetWidth, but the problem is minimal. run.xAdvances.set(run.xAdvances.size - 1, width); }
/** Adjusts the xadvance of the last glyph to use its width instead of xadvance. */ private void adjustLastGlyph (BitmapFontData fontData, GlyphRun run) { Glyph last = run.glyphs.peek(); if (last.fixedWidth) return; float width = (last.width + last.xoffset) * fontData.scaleX - fontData.padRight; run.width += width - run.xAdvances.peek(); // Can cause the run width to be > targetWidth, but the problem is minimal. run.xAdvances.set(run.xAdvances.size - 1, width); }
protected void pop () { root = elements.pop(); if (current.size > 0) lastChild.pop(); current = elements.size > 0 ? elements.peek() : null; }
protected void pop () { root = elements.pop(); if (current.size > 0) lastChild.pop(); current = elements.size > 0 ? elements.peek() : null; }
protected UBJsonWriter pop (boolean silent) throws IOException { if (named) throw new IllegalStateException("Expected an object, array, or value since a name was set."); if (silent) stack.pop(); else stack.pop().close(); current = stack.size == 0 ? null : stack.peek(); return this; }
protected UBJsonWriter pop (boolean silent) throws IOException { if (named) throw new IllegalStateException("Expected an object, array, or value since a name was set."); if (silent) stack.pop(); else stack.pop().close(); current = stack.size == 0 ? null : stack.peek(); return this; }
/** Pops the current scissor rectangle from the stack and sets the new scissor area to the new top of stack rectangle. In case * no more rectangles are on the stack, {@link GL20#GL_SCISSOR_TEST} is disabled. * <p> * Any drawing should be flushed before popping scissors. */ public static Rectangle popScissors () { Rectangle old = scissors.pop(); if (scissors.size == 0) Gdx.gl.glDisable(GL20.GL_SCISSOR_TEST); else { Rectangle scissor = scissors.peek(); HdpiUtils.glScissor((int)scissor.x, (int)scissor.y, (int)scissor.width, (int)scissor.height); } return old; }
/** Pops the current scissor rectangle from the stack and sets the new scissor area to the new top of stack rectangle. In case * no more rectangles are on the stack, {@link GL20#GL_SCISSOR_TEST} is disabled. * <p> * Any drawing should be flushed before popping scissors. */ public static Rectangle popScissors () { Rectangle old = scissors.pop(); if (scissors.size == 0) Gdx.gl.glDisable(GL20.GL_SCISSOR_TEST); else { Rectangle scissor = scissors.peek(); HdpiUtils.glScissor((int)scissor.x, (int)scissor.y, (int)scissor.width, (int)scissor.height); } return old; }
/** @return the current viewport in OpenGL ES window coordinates based on the currently applied scissor */ public static Rectangle getViewport () { if (scissors.size == 0) { viewport.set(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); return viewport; } else { Rectangle scissor = scissors.peek(); viewport.set(scissor); return viewport; } } }
/** @return the current viewport in OpenGL ES window coordinates based on the currently applied scissor */ public static Rectangle getViewport () { if (scissors.size == 0) { viewport.set(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight()); return viewport; } else { Rectangle scissor = scissors.peek(); viewport.set(scissor); return viewport; } } }
/** Indicates that subsequent cells should be added to a new row and returns the cell values that will be used as the defaults * for all cells in the new row. */ public Cell row () { if (cells.size > 0) { if (!implicitEndRow) { if (cells.peek().endRow) return rowDefaults; // Row was already ended. endRow(); } invalidate(); } implicitEndRow = false; if (rowDefaults != null) cellPool.free(rowDefaults); rowDefaults = obtainCell(); rowDefaults.clear(); return rowDefaults; }
/** Indicates that subsequent cells should be added to a new row and returns the cell values that will be used as the defaults * for all cells in the new row. */ public Cell row () { if (cells.size > 0) { if (!implicitEndRow) { if (cells.peek().endRow) return rowDefaults; // Row was already ended. endRow(); } invalidate(); } implicitEndRow = false; if (rowDefaults != null) cellPool.free(rowDefaults); rowDefaults = obtainCell(); rowDefaults.clear(); return rowDefaults; }