Jump to content
Mojo

Slice larger than object??

Recommended Posts

Hi,

 

Please see attached test file.

 

If I create a rectangle and sets the size 256x256.

 

Now I create a slice of that layer, but the slice is automatically set to 259x259.

 

Why is the slice not the same size as the rectangle (256x256)?

 

Thanks

test.afdesign

Share this post


Link to post
Share on other sites

Hi,

 

Please see attached test file.

 

If I create a rectangle and sets the size 256x256.

 

Now I create a slice of that layer, but the slice is automatically set to 259x259.

 

Why is the slice not the same size as the rectangle (256x256)?

 

Thanks

 

Hey there mojo. you are right your box is 256 x 256 but the alignment of your stroke is aligned to the outside of your box. I think you need to align your stroke to the inside of the box.You can achieve this by going into the stroke panel and changing the stroke button for the alignment to align to inside. When you do that I think your slice will align up properly with the accurate dimension of your box shape.

 

updated file attached. hopefully that works for ya.  

 

Cheers

test_ronnies solution.afdesign

Share this post


Link to post
Share on other sites

Hi,

 

Thanks for helping me out here! :)

 

I tried what you said, and now the slice is 258x258 ... I simply can't make it 256x256.

 

I've attached a new sample - can you see what I do wrong?

 

Thanks a million!

 

 

Update: 

 

If I open your sample and click "Revert to auto sized" in the slice-toolbar, then your sample is 259x259.

 

This is strange.

test2.afdesign

Share this post


Link to post
Share on other sites

Yah,no problem. I glad I can be of help.

 

How are you creating your slice? Do you have object snapping on? I have object snapping off at the moment and just went to the transform palette and typed in the the dimensions for the width and height (256px x256px) and then just placed it over the box.

Does that work for you? everything seems to line up fine for me.

Share this post


Link to post
Share on other sites

I click "Export Persona" -> Layers (in the palette) and then select the layer and click "Create Slice".

 

But I found out, that selecting the layer and clicking "Create Slice" will make a 258x258 slice, but if I expand the layer and click the Rectangle and click "Create Slice" then it's 256x256 ... so there's obviously a difference from making a slice from the layer to making a slice of the rectangle itself.

 

:)

 

Thanks for your help.

Share this post


Link to post
Share on other sites

I click "Export Persona" -> Layers (in the palette) and then select the layer and click "Create Slice".

 

But I found out, that selecting the layer and clicking "Create Slice" will make a 258x258 slice, but if I expand the layer and click the Rectangle and click "Create Slice" then it's 256x256 ... so there's obviously a difference from making a slice from the layer to making a slice of the rectangle itself.

 

:)

 

Thanks for your help.

 

Yup! I missed that too! Actually, I didn't think twice about selecting the object of the layer just because I think I am use to doing it now. but I can see this being confusing when all you have is one object and its in a layer. Since I was trying to  solve your problem I was looking beyond the automated feature ( I get too deep sometimes lol). Anyway, I am glad the problem is solved. You taught me something today.

 

Thanks

Share this post


Link to post
Share on other sites

This is actually a peculiarity in the way we apply the affects of lines to the size of an object. Seems inside alignment can be handled better.  It also depends on you having properly closed curve objects.

 

I'll look at fixing it.  We may need a more robust solution later.


SerifLabs team - Affinity Developer
  • Software engineer  -  Photographer  -  Guitarist  -  Philosopher
  • iMac 27" Retina 5K (Late 2015), 4.0GHz i7, AMD Radeon R9 M395
  • MacBook (Early 2015), 1.3GHz Core M, Intel HD 5300
  • iPad Pro 10.5", 256GB

Share this post


Link to post
Share on other sites

ok - I fixed this for the next Beta.  At least, the fix works with the example file above.

 

For closed curve objects with inside lines, the box should be tight.

 

We are still trying to decide if we need to offer a more precise calculation when calculating oversized bounds from lines with centred or outside, and with dashes.  We currently use the line weight and miter limit to approximate the contribution to the bounds size.  It's faster, but less precise.


SerifLabs team - Affinity Developer
  • Software engineer  -  Photographer  -  Guitarist  -  Philosopher
  • iMac 27" Retina 5K (Late 2015), 4.0GHz i7, AMD Radeon R9 M395
  • MacBook (Early 2015), 1.3GHz Core M, Intel HD 5300
  • iPad Pro 10.5", 256GB

Share this post


Link to post
Share on other sites

Wow that was fast! Thanks Ben! as for your statement on the the bound conundrum, I can't really say until I work more extensively with slicing in AD. I might have to do a little web or mobile design project  to see about this. My gut thought is precision is best especially with web work, at least down to the whole pixel. Correct me if I am wrong but I think anything that point something decimals in web/mobile work is bad due to responsive design best practices. 

Share this post


Link to post
Share on other sites

Remember though, you can always adjust the slice to be the size you want it - and it will still only export that node (without any background).  The automatic rectangles will mostly be a good-fit starting point. A little user interaction may be required.


SerifLabs team - Affinity Developer
  • Software engineer  -  Photographer  -  Guitarist  -  Philosopher
  • iMac 27" Retina 5K (Late 2015), 4.0GHz i7, AMD Radeon R9 M395
  • MacBook (Early 2015), 1.3GHz Core M, Intel HD 5300
  • iPad Pro 10.5", 256GB

Share this post


Link to post
Share on other sites

Yup, I agree and I am ok with that. Honestly, I did not even look at the automatic feature. I am old schooler grab your slice tool and drag out your slice. Can't leave it all to the computer and the magic makers that program it. Now only if you can get a mobilize this design button in there and have it slice out and layout wireframes  at a press of a button! lol

Share this post


Link to post
Share on other sites

I just had this same problem but the solution above didn't work because my slices are embedded files. 

 

It turns out that the image's fractional positioning caused the problem. 

 

For example if your image (50x50px) is positioned in (y:100.6 x:50) the slice will be 51x51.

You won't be able to align the slice square onto your image. 

 

I don't know if this is a bug or my lack of knowledge. 

 

I'm not using strokes, so the alignment isn't a problem. 

 

 

I hope this helps anyone with this problem. 

 

 

Update: 

 

I encountered a problem with an image of size 83.5x83.5 

 

The slice size cannot have decimal points, I even changed it manually. 

 

Does anyone have any advice ? 

 

For now I'll try exporting this manually.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×