Skip to content

Commit

Permalink
fix(label): remove padding variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ph1p committed Aug 1, 2022
1 parent b571d18 commit 46d9ff1
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/main/line.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,6 @@ export const createLine = (options) => {
// needed elements
const line = figma.createVector();

const paddingTopBottom = 3;

// LABEL
let labelFrame;
const alignment = isHorizontal ? lineHorizontalAlign : lineVerticalAlign;
Expand Down Expand Up @@ -294,14 +292,11 @@ export const createLine = (options) => {

line.handleMirroring = 'ANGLE_AND_LENGTH';

// x, y for text box
const boxTop = paddingTopBottom / 2;

// place text group
if (labels) {
if (isHorizontal) {
labelFrame.x = 0;
labelFrame.y += boxTop + nodeHeight - LINE_OFFSET - line.strokeWeight;
labelFrame.y += nodeHeight - LINE_OFFSET - line.strokeWeight;

// vertical text align
if (txtVerticalAlign === Alignments.CENTER) {
Expand All @@ -328,7 +323,6 @@ export const createLine = (options) => {
}
} else {
labelFrame.x = 0;
labelFrame.y += boxTop;

// vertical text align
if (txtVerticalAlign === Alignments.CENTER) {
Expand Down

0 comments on commit 46d9ff1

Please sign in to comment.