how to draw smooth line without MSAA - opengl-es

i am figuring out how to draw smooth line using OpenGL ES.
i have done with part of this task as the following steps:
make two triangles to form the line.
make its border transparent.
you can refere to this link old solutioin to see the main idea.
But i still get one problem to solve: how to smooth both end of the line?
you can see the current situation by click the image description.
enter image description here
In the image, you can clearly see the left end of line has sawtooth.
can any one give me a solution? i will thanks a lot!

Add more triangles to form an end-cap, make them transparent in the same way you blend the edges.

Related

Scrollspy using Alpinejs and intersect plugin

I have a website I'm working on that utilizes DaisyUI and Alpine.js (with intersect plugin).
In one of my templates I have a stepper with sections of content relating to each step. When you click one of the steps to the stepper, it scrolls you to the related section. That part is easy peasy. The difficulty is getting the step to highlight when you've scrolled to the related content manually. My lack of understanding of the intersection observer is what is throwing me off.
Here is a pen I made as a simple illustration of what I'm trying to do: https://codepen.io/jtomeck/pen/dyeVONz
The pen only shows the use of x-intersect alone. It works-ish, but you'll notice that there are bugs if you make the viewport taller. I'd ideally like the step to only highlight when the content is near the top of the screen, or at least more than halfway above the center of the viewport. I've tried:
Using threshold, but there are bugs since it does not observe the direction (from top of viewport or bottom of viewport) the intersection is happening from, as well as the threshold being defined as a percent creates strange behaviors on different sized screens.
Using margin, but it did not appear to work at all. I believe this is option is the right solution, but I'm struggling to find the proper resources online specific to my problem. I believe the answer will come if I can figure out how to manipulate the margin using enter and leave.
If someone wouldn't mind helping me with this I'd greatly appreciate it. Bonus points if all previous steps can remain highlighted when a new step is reached :). Not a requirement though!
I'd like to request that all answers continue to utilize alpinejs since it is a constraint of the project. Thank you in advance!
TLDR - Can anyone help me figure out how to use alpinejs and its intersect plugin to make the step of a stepper component highlight when the content it relates to reaches a certain position in the viewport (scrollspy effect)?
Update: Updated codepen to use:
x-intersect.margin.10%.0.0.0="shownStep = ' STEP NUMBER ID HERE '"
According to the documentation the expected behavior would be to detect intersection "when the element gets within 10% of the top of the viewport." It does not appear to work any differently than just using x-intersect without the margin added. I'm very curious why margin does seemingly nothing. I'm going to keep looking into it, but I'd very much appreciate any guidance anyone can provide about rootMargin and why the intersect plugin does not seem to be applying it properly.

Autocad scaling

I'm studing AutoCAD and encountered with a scale problem.
I write a simple detail, but when i'm setting Lineweight 1.00 mm AutoCAD draw 2cm line instead of 1mm line. I tried to change scale in Annotate -> Dimensions -> Scale factor = 0.05, but it didn't help.
Here is two screenshots: how it is with and withoud LWB pressed. It does some crazy things when I want just to create a line a bit thicker than default.
I have the same problem, but this post wasn't very helpful
And this post wasn't neither
I posed it gere according to this aricle that says, that SO is the best options for this kind of questions: https://meta.stackexchange.com/questions/188052/which-stack-exchange-site-is-best-for-autocad-questions
The scale factor only controls the scale of the linetype.
To change the way the lineweight displays on the screen, right click on the "Show/Hide Lineweight" toggle at the very bottom, click "Settings..." and adjust the slider labelled "Adjust Display Scale".
Note that this will not change the printed weight of the lines, just how they show up on your monitor.
Pretty sure the Autodesk forums is the best place to ask an AutoCAD setup question.
Both posts you linked to above (Autodesk forums and AUGI) pertain to plotting and/or PaperSpace but your post is clearly showing ModelSpace.
I would check if you've drawn your sketch using polylines with a defined width. Could be a units issue as well.

Geoserver ExternalGraphic draw icon incorrect

I run into a problem with Geoserver.
I'm drawing multiple icons which each represent a place all over my map using ExternalGraphic.
But geoserver didn't draw them correctly as they are. I attach an image as the result of geoserver drawing:
As you can see, the 2 car icon, both got cut off around 1 pixel comapre to its original size (1 got cut off from top down while another from bottom up). It make same icon look differentfrom place to place. And i think because of this cutting, after lose some pixel, they resize the image back to its original size, which make the $ on top left look blurry compare to the one next to it.
Also as in External graphic document mention, i didn't use any Size attribute so they won't get resize or anything. So i'm not sure why the image got cut off like that.
Any1 can help me about this case ? Thank you in advance.
I suggest you open a report at http://jira.codehaus.org/browse/GEOS attaching one of the images and your style document.

Get theme properties of Group Box lines

My goal is to draw a Group Box that is not rectangular but instead has the corners cut away. I do not mean just clipping the corners, but rather have a continuous closed path where the corners are "indented." I want this to match the colors/style of the current theme.
I noticed on Windows XP that the Group Box has 1-pixel gray lines, but on Windows 7 there is a 3D effect created by having a gray line next to a white line (the white line on the interior except on the bottom where it's below the gray line).
You can get the color of the text label of a Group Box using something like this:
COLORREF cref;
GetThemeColor(hTheme, BP_GROUPBOX, GBS_NORMAL, TMT_TEXTCOLOR, &cref);
So, I'm trying to figure out how to get the color(s) and/or properties of the lines used in a Group Box, then (I hope to) be able to draw the lines I want matching the Group Box style by separately drawing each piece of the shape I want. I'm not sure what properties are used to describe the lines or if functions line DrawRect will draw the 3D effect with a suitable Pen. Is there a way to set a Pen to draw these 3D effects (2-shade parallel lines)?
Thanks.
The thing I always find unexpected about groupboxes is that they are really a style of buttons. (BS_GROUPBOX).
Themed groupboxes (XP and later with classic mode off) use theme part BP_GROUPBOX in VSCLASS_BUTTON. You can use the usual theme APIs to get and draw. If your Group box needs text you can use DrawThemeText.
There are APIs for drawing non-themed group boxes too (e.g. DrawEdge), but I don't remember the details and it's unlikely that you need them.
As usual, I will point out that reproducing the behaviour of controls is always harder than you think it is going to be.
Martyn

joomla curve image problem

I am using joomla 1.5 for one of my cms projects. In the top-left corner there is a box with a curve image. But it shows a rectangle box. When I view the source using firebug its shows the curve image so please help me whats problem besides it.
my site url is
http://sunflowerhospital.in/
thanks in advance
Praveen Kalal
Wow, you should seriously consider recoding all of those tables in to some clean DIVs. You've got like 5 nested tables right around the news box that makes it near impossible to tell what is going on.
Anyhow, I digress. The problem is that the image is 184px wide while your box is only 170px wide. The curves are there, but they are outside the bounds of the table.

Resources