renderstate: disallow line width < 1f

experimental^2^2
Kirill Vainer 9 years ago
parent 13755fb75b
commit 3b5d1eebd8
  1. 3
      jme3-core/src/main/java/com/jme3/material/RenderState.java
  2. 5
      jme3-core/src/main/java/com/jme3/scene/Mesh.java

@ -822,6 +822,9 @@ public class RenderState implements Cloneable, Savable {
* @param lineWidth the line width.
*/
public void setLineWidth(float lineWidth) {
if (lineWidth < 1f) {
throw new IllegalArgumentException("lineWidth must be greater than or equal to 1.0");
}
this.lineWidth = lineWidth;
this.applyLineWidth = true;
cachedHashCode = -1;

@ -175,7 +175,7 @@ public class Mesh implements Savable, Cloneable, JmeCloneable {
private IntMap<VertexBuffer> buffers = new IntMap<VertexBuffer>();
private VertexBuffer[] lodLevels;
private float pointSize = 1;
private float lineWidth = -1;
private float lineWidth = 1;
private transient int vertexArrayID = -1;
@ -634,6 +634,9 @@ public class Mesh implements Savable, Cloneable, JmeCloneable {
*/
@Deprecated
public void setLineWidth(float lineWidth) {
if (lineWidth < 1f) {
throw new IllegalArgumentException("lineWidth must be greater than or equal to 1.0");
}
this.lineWidth = lineWidth;
}

Loading…
Cancel
Save