Skip to content

Commit

Permalink
Refactor: No more EraseStampImage drawing action
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBizzle committed Oct 6, 2016
1 parent 1c60e25 commit ea84abe
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
1 change: 0 additions & 1 deletion netlogo-headless/src/main/drawing/DrawingAction.scala
Expand Up @@ -19,7 +19,6 @@ object DrawingAction {
// I've added some fields that match up to with how NetLogo Web will handle these stamping events.
// --JAB (3/18/15)
case class StampImage(imageBytes: Array[Byte], stamp: AgentStamp) extends DrawingAction
case class EraseStampImage(imageBytes: Array[Byte], stamp: AgentStamp) extends DrawingAction
case class SetColors(colors: Array[Int]) extends DrawingAction
case class SendPixels(dirty: Boolean) extends DrawingAction
case class ReadImage(imageBytes: Array[Byte]) extends DrawingAction
Expand Down
8 changes: 1 addition & 7 deletions netlogo-headless/src/main/drawing/DrawingActionBroker.scala
Expand Up @@ -53,14 +53,8 @@ class DrawingActionBroker(
if (erase) "erase" else "normal")
}

val action =
if (!erase)
StampImage(bytes, stamp)
else
EraseStampImage(bytes, stamp)

// Actually running the Action would needlessly re-apply the bitmap.
publishWithoutRunning(action)
publishWithoutRunning(StampImage(bytes, stamp))

}

Expand Down
2 changes: 0 additions & 2 deletions netlogo-headless/src/main/drawing/DrawingActionRunner.scala
Expand Up @@ -20,8 +20,6 @@ class DrawingActionRunner(
readBytes(imageBytes)
case StampImage(imageBytes, _) =>
readBytes(imageBytes)
case EraseStampImage(imageBytes, _) =>
readBytes(imageBytes)
case CreateDrawing(dirty: Boolean) =>
trailDrawer.getAndCreateDrawing(dirty)
case ImportDrawing(filePath: String) =>
Expand Down

0 comments on commit ea84abe

Please sign in to comment.