Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed text positioning #3

Merged
merged 2 commits into from
Apr 26, 2018
Merged

Conversation

dive-michiel
Copy link
Contributor

Thanks for the library!

Text positioning parameter was wrong, it used the wrong group code and values.
Fixed using correct group codes + adding secondary alignment points.

Code now works as intended:
Position of text from point: 1 = top-left; 2 = top-center; 3 = top-right; 4 = center-left; 5 = center; 6 = center-right; 7 = bottom-left; 8 = bottom-center; 9 = bottom-right

Fix text positioning
Fix alignment with second alignment points
@dive-michiel
Copy link
Contributor Author

Example:

    // Added center point for demponstration
    $dxf->setLayer('centerpoint', Color::RED);
    $dxf->addCircle(0, 0, 0, 0.2);

    // Adding 'A' in all the different positions with 0, 0, 0 as center point
    $dxf->setLayer('letters', Color::WHITE);
    $dxf->addText(0, 0, 0, 'A', 8, 1);
    $dxf->addText(0, 0, 0, 'A', 8, 2);
    $dxf->addText(0, 0, 0, 'A', 8, 3);
    $dxf->addText(0, 0, 0, 'A', 8, 4);
    $dxf->addText(0, 0, 0, 'A', 8, 5);
    $dxf->addText(0, 0, 0, 'A', 8, 6);
    $dxf->addText(0, 0, 0, 'A', 8, 7);
    $dxf->addText(0, 0, 0, 'A', 8, 8);
    $dxf->addText(0, 0, 0, 'A', 8, 9);

Output:

screen shot 2018-04-20 at 14 15 44

@adamasantares adamasantares merged commit 32cc6b4 into KOYU-Tech:master Apr 26, 2018
@adamasantares
Copy link
Collaborator

@u-michiel Hey! Thanks a lot! I've merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants