clipping

Adding a subview larger than cellHeight to a UITableViewCell?

烂漫一生 提交于 2019-11-30 06:42:53
I'm trying to add a subview to a UITableViewCell and the design that I'm working from demands that this particular subview (an image) needs to be larger than the actual UITableViewCell and thus partly overlap its siblings. So I've set up my table cell, generated my image and added it to the cell's contentView: // rowHeight for the UITableView is 45.0f UIImage *image = [self createCellThumbnail: someImage]; UIImageView *thumbView = [[UIImageView alloc] initWithFrame: CGRectMake(150, -5, 55,55)]; thumbView.transform = CGAffineTransformMakeRotation(0.1f); thumbView.image = image; cell

Library for polygon operations [closed]

[亡魂溺海] 提交于 2019-11-30 05:40:54
I've recently encountered a need for a library or set of libraries to handle operations on 2D polygons. I need to be able to perform boolean/clipping operations (difference and union) and triangulation. So far the libraries I've found are poly2tri , CGAL , and GPC . Poly2tri looks good for triangulation but I'm still left with boolean operations, and I'm unsure about its maturity. CGAL and GPC are only free if my own project is free. My particular project isn't commercial, so I'm hesitant to pay or request for any licenses. But I may want to use my code for a future commercial project, so I'm

How can I clip INSIDE a shape in HTML5 canvas?

假如想象 提交于 2019-11-30 05:16:07
I've found a number of examples for clipping the outside region of an arc (e.g.: this example ). I can't seem to figure out how to clip inside the arc shape instead. Here is an example of how I'm currently clipping the outside region, which is essentially the opposite of what I want: ctx.save(); ctx.beginPath(); ctx.arc(x, y, radius, 0, Math.PI * 2, false); ctx.clip(); ctx.beginPath(); ctx.lineWidth = 1; ctx.shadowBlur = 10; ctx.shadowOffsetX = shadowOffset; ctx.shadowColor = '#000000'; ctx.strokeStyle = '#000000'; ctx.arc(x, y, radius, 0, Math.PI * 2, false); ctx.stroke(); ctx.restore();

Clip div with SVG path

走远了吗. 提交于 2019-11-29 16:45:43
I have two overlapping divs and I am trying to achieve the following effect: In order to do that my logic is to get the two divs to overlap, create that shape with SVG inside the second div and use that shape to clip the second div and show what’s below it (the top div). I’m not sure if this is the best logic to follow to achieve this and if it is I’m not sure how to use the SVG to clip the HTML element. This is my HTML so far: <div class="banner_1"> </div> <div class="banner_2"> <svg viewBox="0 0 500 500" preserveAspectRatio="xMinYMin meet"> <path d="M0,20 C100,80 350,0 500,30 L500,00 L0,0 Z"

glsurfaceview inside a scrollview, moving but not clipping

拈花ヽ惹草 提交于 2019-11-29 16:31:24
I have a scrollview with a linear layout inside. One of the elements inside this linearlayout is a glsurfaceview. This all works correctly and when I scroll the glsurfaceview moves up and down however when the glsurfaceview reaches the top or bottom of where it should of the scrollview where it should be clipped it is not and is continued outside of the scrollview. This screenshot should make it clearer: Don't think it's completly nessecary but here is my layout.xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout

OpenGL sutherland-hodgman polygon clipping algorithm in homogeneous coordinates (4D, CCS)

倾然丶 夕夏残阳落幕 提交于 2019-11-29 16:20:40
I have two questions. (I marked 1, 2 below) In OpenGl, the clipping is done by sutherland-hodgman. However, I wonder how to work sutherland-hodgman algorithm in homogeneous system (4D) I made a situation. In VCS, there is a line, R= (0, 3, -2, 1), S = (0, 0, 1, 1) (End points of the line) And a frustum is right = 1, left = -1, near = 1, far = 3, top = 4, bottom = -4 Therefore, the projection matrix P is 1 0 0 0 0 1/4 0 0 0 0 -2 -3 0 0 -1 0 If we calculate the line with the P, then the each end points is like that R' = (0, 3/4, 1, 2), S' = (0, 0, -5, -1) I know that perspective division should

OpenGL clipping

情到浓时终转凉″ 提交于 2019-11-29 07:36:14
I have been reading articles about clipping now for hours now but I dont seem to find a solution for my problem. This is my scenario: Within an OpenGL ES environment (IOS,Android) I am having a 2D scene graph consisting of drawable objects, forming a tree. Each tree node has its own spatial room with it's own transformation matrix, and each node inherits its coordinate space to its children. Each node has a rectangular bounding box, but these bounding boxes are not axis aligned. This setup works perfect to render a 2D scene graph, iterating through the tree, rendering each object and then it's

Adding a subview larger than cellHeight to a UITableViewCell?

会有一股神秘感。 提交于 2019-11-29 06:33:01
问题 I'm trying to add a subview to a UITableViewCell and the design that I'm working from demands that this particular subview (an image) needs to be larger than the actual UITableViewCell and thus partly overlap its siblings. So I've set up my table cell, generated my image and added it to the cell's contentView: // rowHeight for the UITableView is 45.0f UIImage *image = [self createCellThumbnail: someImage]; UIImageView *thumbView = [[UIImageView alloc] initWithFrame: CGRectMake(150, -5, 55,55)

Library for polygon operations [closed]

天大地大妈咪最大 提交于 2019-11-29 03:52:17
问题 I've recently encountered a need for a library or set of libraries to handle operations on 2D polygons. I need to be able to perform boolean/clipping operations (difference and union) and triangulation. So far the libraries I've found are poly2tri, CGAL, and GPC. Poly2tri looks good for triangulation but I'm still left with boolean operations, and I'm unsure about its maturity. CGAL and GPC are only free if my own project is free. My particular project isn't commercial, so I'm hesitant to pay

Can you have multiple clipping regions in an HTML Canvas?

China☆狼群 提交于 2019-11-29 02:30:53
I have code that loads a bunch of images into hidden img elements and then a Javascript loop which places each image onto the canvas. However, I want to clip each image so that it is a circle when placed on the canvas. My loop looks like this: $$('#avatars img').each(function(avatar) { var canvas = $('canvas'); var context = canvas.getContext('2d'); var x = Math.floor(Math.random() * canvas.width); var y = Math.floor(Math.random() * canvas.height); context.beginPath(); context.arc(x+24, y+24, 20, 0, Math.PI * 2, 1); context.clip(); context.strokeStyle = "black"; context.drawImage(document