package net.voxelindustry.brokkgui.shape;

import net.voxelindustry.brokkgui.internal.IGuiRenderer;
import net.voxelindustry.brokkgui.paint.RenderPass;

public class Line extends GuiShape
{
    public Line(final float startX, final float startY, final float endX, final float endY)
    {
        super("line");
        this.setxTranslate(startX);
        this.setyTranslate(startY);

        this.setWidth(endX);
        this.setHeight(endY);
    }

    public Line(final float endX, final float endY)
    {
        this(0, 0, endX, endY);
    }

    public Line()
    {
        this(0, 0);
    }

    @Override
    public void renderContent(final IGuiRenderer renderer, final RenderPass pass, final int mouseX, final int mouseY)
    {
        if (pass == RenderPass.MAIN)
            renderer.getHelper().drawColoredLine(renderer, this.getxPos() + this.getxTranslate(),
                    this.getyPos() + this.getyTranslate(), this.getxPos() + this.getWidth(),
                    this.getyPos() + this.getHeight(), this.getLineWeight(), this.getzLevel(), this.getColor());
    }
}
@@ -195,30 +195,24 @@
 public Line(
-final 
 float startX
@@ -212,22 +212,16 @@
  startX,
- final
  float s
@@ -226,22 +226,16 @@
  startY,
- final
  float e
@@ -230,38 +230,32 @@
 rtY, float endX,
- final
  float endY)%0A   
@@ -379,13 +379,32 @@
 dth(
+Math.abs(startX - 
 endX)
+)
 ;%0A  
@@ -424,21 +424,40 @@
 tHeight(
+Math.abs(startY - 
 endY)
+)
 ;%0A    %7D%0A
@@ -473,22 +473,16 @@
 ic Line(
-final 
 float en
@@ -484,22 +484,16 @@
 at endX,
- final
  float e
@@ -637,22 +637,16 @@
 Content(
-final 
 IGuiRend
@@ -659,22 +659,16 @@
 enderer,
- final
  RenderP
@@ -676,22 +676,16 @@
 ss pass,
- final
  int mou
@@ -692,14 +692,8 @@
 seX,
- final
  int

Fix Line width and height using end point instead of magnitude