Indesign Bug? Choosing Fancy Corners Reverses Function of Align Stroke Inside/Outside - alignment

I think that this might be a bug in InDesign but I thought that it might be handy to know.
Here's how to recreate: Create a rectangle 200px x 200px, with a 4pt stroke. Set Align stroke to INSIDE. Set the top left xy pos of the rectangle to 100px,100px so that you can easily see changes, and leave the Reference Point in the top left. Now when you change stroke widths, everything is fine, and change corner types, everything is fine, EXCEPT the Fancy Corners. So if you choose Fancy Corners, the x/y becomes 96,96 and total width/height changes to 208 x 208 which is incorrect. Now change the Align Stroke to "OUTSIDE", and the x/y changes back to 100,100 and the rectangle size changes back to 200 x 200. Completely backwards, but just for the Fancy Corners.
Please comment if this is an expected response.

Related

Roblox Lua Script, How to make a frame decrease its size from left to right?

I'm trying to make a health bar that decreases from left to right instead of from right to left
and it has to be this way because of how the interface looks, I've tried different calculations but all of them were close but too far and I'm running out of ideas on how to make it
Take a look into anchor point.
What anchor point does is set the origin of the UI. So for your use case, you'll probably want to set the anchor point to [1,0]. Which means the UI will scale to the left
(White Box) Anchor point 0,0
(White Box) Anchor point 1,0
With an anchor point of 1,0, it will scale to the left

How do create a mask and draw on it

I have 2 rectangles like the image below :
now I want to only draw the part of yellow rectangle (B) that is inside the red rectangle. So i set clipchildreen=True to the rectangle A and I get this :
But it's not good as part of the yellow rectangle outside the red rectangle is still drawed. I want to obtain this :
How Can I do ? Eventually I can draw directly on the canvas but even like this I didn't find a simple way to achieve what I want to do
Here is a solution that might suit you, although I've made some assumptions about what your requirements are, and it's not a particularly straightforward approach. It involves using a rectangle with InnerRound corners to hide part of the yellow square.
For the steps below, I'm assuming that the form is white, the yellow square is 50 x 50, the red square is 150 x 150, the round corners have a radius of 20, and the whole thing is positioned on the form at 100,100.
I've described this as though you are manually positioning all the controls straight onto the form, but if I was doing it I'd add a couple of TLayouts and use Aligns everywhere (with negative margins in the case of the fourth step). And you might do this on a panel or other control instead of directly on the form.
Note that the z-order is important, which is why steps 2 to 5 below should be done in that order.
Set Fill.Kind of the form to Solid.
Place a TRectangle at 100,100. Set both XRadius and YRadius to 20, both Width and Height to 150, Fill.Color to Red and Stroke.Kind to None.
Place a TRectangle at 100,100. Set the Fill.Color to Yellow.
Place a TRectangle at 80,80. Set both XRadius and YRadius to 20, both Height and Width to 20, Fill.Color to White (the Fill.color of the form), Stroke.Kind to None, and CornerType to InnerRound.
Place a TRectangle at 100,100. Set both XRadius and YRadius to 20, both Height and Width to 150, and Fill.Kind to None.
This is the result:

Curved Path2D becomes straight when increasing stroke size

I have this strange problem with Java2D. I have a Path2D.Double that I want to draw, but depending on the stroke size, all segments are drawn correctly (curved) but when the stroke size is greater or equal than 0.00005d the segments are drawn straight. As you can see, the only parameter I'm changing is the stroke size. What am I doing wrong?
BasicStroke basicStroke1 = new BasicStroke(.00004f, CAP_ROUND, JOIN_ROUND);
g2draw.setStroke(basicStroke1);
g2draw.draw(path);
BasicStroke basicStroke2 = new BasicStroke(.00006f, CAP_ROUND, JOIN_ROUND);
g2draw.setStroke(basicStroke2);
g2draw.draw(path);
And here a picture with the result of this code:
Turns out the error seems to be rounding errors when transforming user coordinates to screen coordinates, when the scale difference is big (or not so big...). It's an odd behaviour of Java2D. Switched to JavaFX and the problem disappeared.

What do the coordinates mean in love.graphics.polygon

I don't know which numbers do what in the coordinates example here. I imagine they mean things like place the top left corner at this position and the bottom right corner at this position, but I don't know which number corresponds to which position.
I've been trying to fool around with the numbers to get a small green rectangle but keep getting weird results like the following, and don't know which numbers need to be what is order to make the rectangle symmetrical and at the bottom
This is what the rectangle should look like
The height of the rectangle is 50, the height of the screen is 1000, and the width of the screen is 1700.
Here's my draw function
function love.draw()
love.graphics.setColor(0.28, 0.63, 0.05) -- set the drawing color to green for the ground
love.graphics.polygon("fill", objects.ground.body:getWorldPoints(objects.ground.shape:getPoints())) -- draw a "filled in" polygon using the ground's coordinates
-- These are the grounds coordinates. -11650 950 13350 950 13350 1000 -11650 1000
love.graphics.setColor(0.76, 0.18, 0.05) --set the drawing color to red for the ball
love.graphics.circle("fill", objects.ball.body:getX(), objects.ball.body:getY(), objects.ball.shape:getRadius())
love.graphics.setColor(0.20, 0.20, 0.20) -- set the drawing color to grey for the blocks
love.graphics.polygon("fill", objects.block1.body:getWorldPoints(objects.block1.shape:getPoints()))
love.graphics.polygon("fill", objects.block2.body:getWorldPoints(objects.block2.shape:getPoints()))
print(objects.block1.body:getWorldPoints(objects.block1.shape:getPoints()))
end
As described at https://love2d.org/wiki/love.graphics, Löve's coordinate system has (0, 0) at the upper left corner of the screen. X values increase to the right, Y values increase down.
The polygon function expects the drawing mode as it's first parameter, and the the remaining (variable) parameters are the coordinates of the vertices of the polygon you wish to draw. Since you want to draw a rectangle you need four vertices/eight numbers. You do not have to list the upper left corner of the rectangle first, but that's probably the easiest thing to do.
So in your case, you want something like:
love.graphics.polygon('fill', 0, 950, 0, 1000, 1700, 1000, 1700, 950)
I've not worked with the physics system, so I'm not quite sure how it's coordinate system relates to "screen" coordinates. The values you show in the comment in your code listing seem like they should give a rectangle (although x = -11650 wouldn't be on screen). You might try experimenting without the physics system first.
Also, since the physics system in Löve is just a binding to Box2D, you might want to read its documentation (http://box2d.org/about/). Not really sure what you're trying to do with feeding shape:getPoints into body:getWorldPoints.

objective-c, psd, makeup

Does anybody know how to make correct image and (UIlabel)label position for iphone and ipad
according to the layout image in psd file.
I'm using photoshop. I take a ruler look for the highest letter in the sentence(which should be positioned) and move it to the top of psd image, than take the left extreme letter and move ruler to the left.
Then i make a screenshot of the ipad/iphone screen and compare the x,y of psd and png file.
if psd x/y more then png x/y i make the next steps: Xpsd - Xpng, Ypsd - Ypsd, and if the coordinates of psd less than png i make Xpsd + Xpng, Ypsd + Ypsd.
And finally i have wrong visual position in ipad/iphone!
The most common reasons why the visual position/dimensions of a given element don't match what you think they should is typically the auto resizing mask that is applied to the particular view in question.
For example, your UILabel should have its autoresizing mask set to:
label.autoResizingMask = UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleRightMargin;
This will keep your label aligned to the top left, and will not allow its height, nor its width to be changed depending on the super view's size changes.
This can also be set in interface builder with these controls:
The outer lines match the margin sizing, if it is a solid red line, then that means that as the superview's size changes, the current view's position relative to those edges will be preserved.
The Inner lines represent a flexible width, and height. If it is a solid line, then that means that the current view will resize to retain the same proportion of the superview's size.

Resources