Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

15
LINES

< > BotCompany Repo | #1035269 // onePathToShape

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (8757L/49K).

static Shape onePathToShape(OnePath onePath) {
  if (onePath == null) null;
  
  new Path2D.Float path;
  Iterator<Pt> it = onePath.pointIterator();
  Pt p = it.next();
  path.moveTo(p.x, p.y);
  
  while (it.hasNext()) {
    p = it.next();
    path.lineTo(p.x, p.y);
  }
  
  ret path;
}

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1035269
Snippet name: onePathToShape
Eternal ID of this version: #1035269/1
Text MD5: 6cb35f997377237dd9d625849450c8a4
Transpilation MD5: a3064dac7b9de8800ceeb1fdc265872d
Author: stefan
Category: javax / gazelle 22
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-04-28 17:22:03
Source code size: 302 bytes / 15 lines
Pitched / IR pitched: No / No
Views / Downloads: 52 / 78
Referenced in: [show references]