renderstate: disallow line width < 1f
This commit is contained in:
parent
13755fb75b
commit
3b5d1eebd8
@ -822,6 +822,9 @@ public class RenderState implements Cloneable, Savable {
|
|||||||
* @param lineWidth the line width.
|
* @param lineWidth the line width.
|
||||||
*/
|
*/
|
||||||
public void setLineWidth(float lineWidth) {
|
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.lineWidth = lineWidth;
|
||||||
this.applyLineWidth = true;
|
this.applyLineWidth = true;
|
||||||
cachedHashCode = -1;
|
cachedHashCode = -1;
|
||||||
|
@ -175,7 +175,7 @@ public class Mesh implements Savable, Cloneable, JmeCloneable {
|
|||||||
private IntMap<VertexBuffer> buffers = new IntMap<VertexBuffer>();
|
private IntMap<VertexBuffer> buffers = new IntMap<VertexBuffer>();
|
||||||
private VertexBuffer[] lodLevels;
|
private VertexBuffer[] lodLevels;
|
||||||
private float pointSize = 1;
|
private float pointSize = 1;
|
||||||
private float lineWidth = -1;
|
private float lineWidth = 1;
|
||||||
|
|
||||||
private transient int vertexArrayID = -1;
|
private transient int vertexArrayID = -1;
|
||||||
|
|
||||||
@ -634,6 +634,9 @@ public class Mesh implements Savable, Cloneable, JmeCloneable {
|
|||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public void setLineWidth(float lineWidth) {
|
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.lineWidth = lineWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user